@pimolu/react 0.1.0-beta.1 → 0.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +23 -14
- package/README.md +23 -13
- package/dist/animation/animation-engine.d.ts +22 -0
- package/dist/animation/animation-engine.d.ts.map +1 -0
- package/dist/chart/chart.d.ts.map +1 -1
- package/dist/chart/chart.types.d.ts +16 -4
- package/dist/chart/chart.types.d.ts.map +1 -1
- package/dist/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/circular-progress/circular-progress.types.d.ts +2 -2
- package/dist/circular-progress/circular-progress.types.d.ts.map +1 -1
- package/dist/gantt/gantt.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +908 -628
- package/dist/index.js.map +4 -4
- package/dist/internal/use-merged-refs.d.ts +4 -0
- package/dist/internal/use-merged-refs.d.ts.map +1 -0
- package/dist/internal/use-retained-items.d.ts +8 -0
- package/dist/internal/use-retained-items.d.ts.map +1 -0
- package/dist/kanban/kanban.d.ts.map +1 -1
- package/dist/page-header/page-header.d.ts.map +1 -1
- package/dist/page-header/page-header.types.d.ts +4 -0
- package/dist/page-header/page-header.types.d.ts.map +1 -1
- package/dist/page-header/page-header.variants.d.ts +11 -0
- package/dist/page-header/page-header.variants.d.ts.map +1 -0
- package/dist/scheduler/scheduler.d.ts +1 -1
- package/dist/scheduler/scheduler.d.ts.map +1 -1
- package/dist/scheduler/scheduler.types.d.ts +2 -0
- package/dist/scheduler/scheduler.types.d.ts.map +1 -1
- package/dist/sidebar/sidebar.d.ts.map +1 -1
- package/dist/tree-table/tree-table.d.ts +1 -1
- package/dist/tree-table/tree-table.d.ts.map +1 -1
- package/dist/tree-table/tree-table.types.d.ts +2 -0
- package/dist/tree-table/tree-table.types.d.ts.map +1 -1
- package/package.json +57 -56
- package/LICENSE +0 -21
package/dist/index.js
CHANGED
|
@@ -4560,9 +4560,11 @@ var CircularProgress = forwardRef20(function CircularProgress2({
|
|
|
4560
4560
|
...props
|
|
4561
4561
|
}, forwardedRef) {
|
|
4562
4562
|
const indeterminate = value === void 0 || !Number.isFinite(value);
|
|
4563
|
-
const
|
|
4564
|
-
const
|
|
4565
|
-
const
|
|
4563
|
+
const validMax = Number.isFinite(max) && max > 0;
|
|
4564
|
+
const effectiveMax = validMax ? max : 100;
|
|
4565
|
+
const clamped = indeterminate || !validMax ? 0 : Math.min(Math.max(value, 0), effectiveMax);
|
|
4566
|
+
const percent = clamped / effectiveMax * 100;
|
|
4567
|
+
const displayed = formatValue ? formatValue(clamped, effectiveMax) : `${Math.round(percent)}%`;
|
|
4566
4568
|
const classes38 = [
|
|
4567
4569
|
circularProgressVariants({ size, variant }),
|
|
4568
4570
|
indeterminate && "pimolu-circular-progress--indeterminate",
|
|
@@ -4577,11 +4579,13 @@ var CircularProgress = forwardRef20(function CircularProgress2({
|
|
|
4577
4579
|
...props,
|
|
4578
4580
|
ref: forwardedRef,
|
|
4579
4581
|
className: classes38,
|
|
4582
|
+
"data-empty": !indeterminate && percent === 0 ? "true" : void 0,
|
|
4583
|
+
"data-complete": !indeterminate && percent === 100 ? "true" : void 0,
|
|
4580
4584
|
role: "progressbar",
|
|
4581
4585
|
"aria-label": label ?? ariaLabel,
|
|
4582
4586
|
"aria-describedby": ariaDescribedBy,
|
|
4583
4587
|
"aria-valuemin": 0,
|
|
4584
|
-
"aria-valuemax":
|
|
4588
|
+
"aria-valuemax": effectiveMax,
|
|
4585
4589
|
"aria-valuenow": indeterminate ? void 0 : clamped,
|
|
4586
4590
|
"aria-valuetext": valueLabel,
|
|
4587
4591
|
children: [
|
|
@@ -4624,6 +4628,7 @@ var CircularProgress = forwardRef20(function CircularProgress2({
|
|
|
4624
4628
|
{
|
|
4625
4629
|
className: "pimolu-circular-progress__value",
|
|
4626
4630
|
"aria-hidden": "true",
|
|
4631
|
+
title: displayed,
|
|
4627
4632
|
children: displayed
|
|
4628
4633
|
}
|
|
4629
4634
|
)
|
|
@@ -7629,7 +7634,7 @@ function NavbarActions({
|
|
|
7629
7634
|
}
|
|
7630
7635
|
|
|
7631
7636
|
// sidebar/sidebar.tsx
|
|
7632
|
-
import { useState as useState23, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
7637
|
+
import { useEffect as useEffect18, useRef as useRef19, useState as useState23, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
7633
7638
|
import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7634
7639
|
function classes8(base, className) {
|
|
7635
7640
|
return [base, className].filter(Boolean).join(" ");
|
|
@@ -7661,6 +7666,14 @@ function Sidebar({
|
|
|
7661
7666
|
const mobile = useSyncExternalStore2(subscribeMobile, mobileSnapshot, () => false);
|
|
7662
7667
|
const [internalCollapsed, setInternalCollapsed] = useState23(defaultCollapsed);
|
|
7663
7668
|
const isCollapsed = collapsible && (collapsed ?? internalCollapsed ?? (collapseOnMobile && mobile));
|
|
7669
|
+
const sidebarRef = useRef19(null);
|
|
7670
|
+
const toggleRef = useRef19(null);
|
|
7671
|
+
useEffect18(() => {
|
|
7672
|
+
const active = sidebarRef.current?.ownerDocument.activeElement;
|
|
7673
|
+
if (isCollapsed && active && active !== toggleRef.current && sidebarRef.current?.contains(active)) {
|
|
7674
|
+
toggleRef.current?.focus();
|
|
7675
|
+
}
|
|
7676
|
+
}, [isCollapsed]);
|
|
7664
7677
|
function toggleCollapsed() {
|
|
7665
7678
|
const next = !isCollapsed;
|
|
7666
7679
|
if (collapsed === void 0) setInternalCollapsed(next);
|
|
@@ -7670,15 +7683,16 @@ function Sidebar({
|
|
|
7670
7683
|
"aside",
|
|
7671
7684
|
{
|
|
7672
7685
|
...props,
|
|
7686
|
+
ref: sidebarRef,
|
|
7673
7687
|
"data-sticky": sticky || void 0,
|
|
7674
7688
|
"data-collapsed": isCollapsed || void 0,
|
|
7675
7689
|
className: classes8("pimolu-sidebar", className),
|
|
7676
7690
|
children: [
|
|
7677
|
-
children,
|
|
7678
7691
|
collapsible && /* @__PURE__ */ jsx39(
|
|
7679
7692
|
"button",
|
|
7680
7693
|
{
|
|
7681
7694
|
type: "button",
|
|
7695
|
+
ref: toggleRef,
|
|
7682
7696
|
className: "pimolu-sidebar__toggle",
|
|
7683
7697
|
"aria-label": isCollapsed ? expandLabel : collapseLabel,
|
|
7684
7698
|
"aria-expanded": !isCollapsed,
|
|
@@ -7688,7 +7702,8 @@ function Sidebar({
|
|
|
7688
7702
|
/* @__PURE__ */ jsx39("path", { d: "M7 3v14" })
|
|
7689
7703
|
] })
|
|
7690
7704
|
}
|
|
7691
|
-
)
|
|
7705
|
+
),
|
|
7706
|
+
children
|
|
7692
7707
|
]
|
|
7693
7708
|
}
|
|
7694
7709
|
);
|
|
@@ -7820,9 +7835,9 @@ function SidebarFooter({
|
|
|
7820
7835
|
import {
|
|
7821
7836
|
createContext as createContext10,
|
|
7822
7837
|
useContext as useContext10,
|
|
7823
|
-
useEffect as
|
|
7838
|
+
useEffect as useEffect19,
|
|
7824
7839
|
useId as useId19,
|
|
7825
|
-
useRef as
|
|
7840
|
+
useRef as useRef20,
|
|
7826
7841
|
useState as useState24
|
|
7827
7842
|
} from "react";
|
|
7828
7843
|
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
@@ -7881,14 +7896,14 @@ function NavigationMenu({
|
|
|
7881
7896
|
const [openValue, setOpenValue] = useState24(
|
|
7882
7897
|
null
|
|
7883
7898
|
);
|
|
7884
|
-
const rootRef =
|
|
7899
|
+
const rootRef = useRef20(null);
|
|
7885
7900
|
const baseId = `pimolu-navigation-menu-${useId19()}`;
|
|
7886
7901
|
useOutsidePointer(
|
|
7887
7902
|
rootRef,
|
|
7888
7903
|
openValue !== null,
|
|
7889
7904
|
() => setOpenValue(null)
|
|
7890
7905
|
);
|
|
7891
|
-
|
|
7906
|
+
useEffect19(() => {
|
|
7892
7907
|
if (openValue === null) return;
|
|
7893
7908
|
function handleKeyDown(event) {
|
|
7894
7909
|
if (event.key !== "Escape" || openValue === null) return;
|
|
@@ -8117,8 +8132,8 @@ function ScrollArea({
|
|
|
8117
8132
|
|
|
8118
8133
|
// tree-view/tree-view.tsx
|
|
8119
8134
|
import {
|
|
8120
|
-
useEffect as
|
|
8121
|
-
useRef as
|
|
8135
|
+
useEffect as useEffect20,
|
|
8136
|
+
useRef as useRef21,
|
|
8122
8137
|
useState as useState25
|
|
8123
8138
|
} from "react";
|
|
8124
8139
|
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
@@ -8178,8 +8193,8 @@ function TreeView({
|
|
|
8178
8193
|
const selectedId = isSelectedControlled ? controlledSelected : uncontrolledSelected;
|
|
8179
8194
|
const visible = flatten(items, expanded);
|
|
8180
8195
|
const [focusedId, setFocusedId] = useState25(selectedId ?? visible[0]?.item.id);
|
|
8181
|
-
const refs =
|
|
8182
|
-
|
|
8196
|
+
const refs = useRef21(/* @__PURE__ */ new Map());
|
|
8197
|
+
useEffect20(() => {
|
|
8183
8198
|
if (focusedId && visible.some((node) => node.item.id === focusedId)) {
|
|
8184
8199
|
return;
|
|
8185
8200
|
}
|
|
@@ -8557,12 +8572,12 @@ import {
|
|
|
8557
8572
|
useCallback as useCallback9,
|
|
8558
8573
|
useContext as useContext11,
|
|
8559
8574
|
useId as useId20,
|
|
8560
|
-
useRef as
|
|
8575
|
+
useRef as useRef23,
|
|
8561
8576
|
useState as useState27
|
|
8562
8577
|
} from "react";
|
|
8563
8578
|
|
|
8564
8579
|
// internal/use-presence.ts
|
|
8565
|
-
import { useEffect as
|
|
8580
|
+
import { useEffect as useEffect21, useRef as useRef22, useState as useState26 } from "react";
|
|
8566
8581
|
function prefersReducedMotion5() {
|
|
8567
8582
|
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
8568
8583
|
}
|
|
@@ -8571,7 +8586,7 @@ function usePresence(open, exitDuration = 150) {
|
|
|
8571
8586
|
const [state, setState] = useState26(
|
|
8572
8587
|
"open"
|
|
8573
8588
|
);
|
|
8574
|
-
const timer =
|
|
8589
|
+
const timer = useRef22(
|
|
8575
8590
|
null
|
|
8576
8591
|
);
|
|
8577
8592
|
function cancel() {
|
|
@@ -8580,7 +8595,7 @@ function usePresence(open, exitDuration = 150) {
|
|
|
8580
8595
|
timer.current = null;
|
|
8581
8596
|
}
|
|
8582
8597
|
}
|
|
8583
|
-
|
|
8598
|
+
useEffect21(() => {
|
|
8584
8599
|
if (open) {
|
|
8585
8600
|
cancel();
|
|
8586
8601
|
setRendered(true);
|
|
@@ -8599,7 +8614,7 @@ function usePresence(open, exitDuration = 150) {
|
|
|
8599
8614
|
}, exitDuration);
|
|
8600
8615
|
return cancel;
|
|
8601
8616
|
}, [open, rendered, exitDuration]);
|
|
8602
|
-
|
|
8617
|
+
useEffect21(() => cancel, []);
|
|
8603
8618
|
return { rendered, state };
|
|
8604
8619
|
}
|
|
8605
8620
|
|
|
@@ -8632,9 +8647,9 @@ function DropdownMenu({
|
|
|
8632
8647
|
},
|
|
8633
8648
|
[controlledOpen, onOpenChange]
|
|
8634
8649
|
);
|
|
8635
|
-
const triggerRef =
|
|
8636
|
-
const contentRef =
|
|
8637
|
-
const scopeRef =
|
|
8650
|
+
const triggerRef = useRef23(null);
|
|
8651
|
+
const contentRef = useRef23(null);
|
|
8652
|
+
const scopeRef = useRef23(null);
|
|
8638
8653
|
const contentId = `pimolu-dropdown-${useId20()}`;
|
|
8639
8654
|
const context = {
|
|
8640
8655
|
open,
|
|
@@ -8982,16 +8997,16 @@ import {
|
|
|
8982
8997
|
isValidElement as isValidElement8,
|
|
8983
8998
|
useCallback as useCallback10,
|
|
8984
8999
|
useContext as useContext12,
|
|
8985
|
-
useEffect as
|
|
9000
|
+
useEffect as useEffect23,
|
|
8986
9001
|
useId as useId21,
|
|
8987
9002
|
useMemo as useMemo5,
|
|
8988
|
-
useRef as
|
|
9003
|
+
useRef as useRef24,
|
|
8989
9004
|
useState as useState28
|
|
8990
9005
|
} from "react";
|
|
8991
9006
|
|
|
8992
9007
|
// internal/use-focus-trap.ts
|
|
8993
9008
|
import {
|
|
8994
|
-
useEffect as
|
|
9009
|
+
useEffect as useEffect22
|
|
8995
9010
|
} from "react";
|
|
8996
9011
|
function useFocusTrap({
|
|
8997
9012
|
active,
|
|
@@ -8999,7 +9014,7 @@ function useFocusTrap({
|
|
|
8999
9014
|
returnFocusRef,
|
|
9000
9015
|
initialFocus = "first"
|
|
9001
9016
|
}) {
|
|
9002
|
-
|
|
9017
|
+
useEffect22(() => {
|
|
9003
9018
|
if (!active) return;
|
|
9004
9019
|
const container = containerRef.current;
|
|
9005
9020
|
if (!container) return;
|
|
@@ -9114,10 +9129,10 @@ function Drawer({
|
|
|
9114
9129
|
const [uncontrolledOpen, setUncontrolledOpen] = useState28(defaultOpen);
|
|
9115
9130
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
9116
9131
|
const contentId = `pimolu-drawer-${useId21()}`;
|
|
9117
|
-
const scopeRef =
|
|
9132
|
+
const scopeRef = useRef24(
|
|
9118
9133
|
null
|
|
9119
9134
|
);
|
|
9120
|
-
const triggerRef =
|
|
9135
|
+
const triggerRef = useRef24(null);
|
|
9121
9136
|
const [titleId, setTitleId] = useState28(null);
|
|
9122
9137
|
const [descriptionId, setDescriptionId] = useState28(null);
|
|
9123
9138
|
const setOpen = useCallback10(
|
|
@@ -9208,7 +9223,7 @@ function DrawerSurface({
|
|
|
9208
9223
|
returnFocusRef: triggerRef,
|
|
9209
9224
|
initialFocus: "container"
|
|
9210
9225
|
});
|
|
9211
|
-
|
|
9226
|
+
useEffect23(() => {
|
|
9212
9227
|
if (!open) return;
|
|
9213
9228
|
const content = contentRef.current;
|
|
9214
9229
|
if (!content) return;
|
|
@@ -9272,7 +9287,7 @@ function DrawerContent({
|
|
|
9272
9287
|
scopeRef,
|
|
9273
9288
|
triggerRef
|
|
9274
9289
|
} = useDrawer("DrawerContent");
|
|
9275
|
-
const contentRef =
|
|
9290
|
+
const contentRef = useRef24(
|
|
9276
9291
|
null
|
|
9277
9292
|
);
|
|
9278
9293
|
const { rendered, state } = usePresence(
|
|
@@ -9366,7 +9381,7 @@ function DrawerTitle({
|
|
|
9366
9381
|
const { setTitleId } = useDrawer("DrawerTitle");
|
|
9367
9382
|
const generatedId = useId21();
|
|
9368
9383
|
const titleId = id ?? `pimolu-drawer-title-${generatedId}`;
|
|
9369
|
-
|
|
9384
|
+
useEffect23(() => {
|
|
9370
9385
|
setTitleId(titleId);
|
|
9371
9386
|
return () => setTitleId(
|
|
9372
9387
|
(current) => current === titleId ? null : current
|
|
@@ -9392,7 +9407,7 @@ function DrawerDescription({
|
|
|
9392
9407
|
const { setDescriptionId } = useDrawer("DrawerDescription");
|
|
9393
9408
|
const generatedId = useId21();
|
|
9394
9409
|
const descriptionId = id ?? `pimolu-drawer-description-${generatedId}`;
|
|
9395
|
-
|
|
9410
|
+
useEffect23(() => {
|
|
9396
9411
|
setDescriptionId(descriptionId);
|
|
9397
9412
|
return () => setDescriptionId(
|
|
9398
9413
|
(current) => current === descriptionId ? null : current
|
|
@@ -9433,10 +9448,10 @@ import {
|
|
|
9433
9448
|
isValidElement as isValidElement9,
|
|
9434
9449
|
useCallback as useCallback11,
|
|
9435
9450
|
useContext as useContext13,
|
|
9436
|
-
useEffect as
|
|
9451
|
+
useEffect as useEffect24,
|
|
9437
9452
|
useId as useId22,
|
|
9438
9453
|
useLayoutEffect as useLayoutEffect2,
|
|
9439
|
-
useRef as
|
|
9454
|
+
useRef as useRef25,
|
|
9440
9455
|
useState as useState29
|
|
9441
9456
|
} from "react";
|
|
9442
9457
|
import { jsx as jsx49, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -9495,9 +9510,9 @@ function ContextMenu({
|
|
|
9495
9510
|
y: 0
|
|
9496
9511
|
});
|
|
9497
9512
|
const open = controlledOpen === void 0 ? uncontrolledOpen : controlledOpen;
|
|
9498
|
-
const triggerRef =
|
|
9499
|
-
const contentRef =
|
|
9500
|
-
const scopeRef =
|
|
9513
|
+
const triggerRef = useRef25(null);
|
|
9514
|
+
const contentRef = useRef25(null);
|
|
9515
|
+
const scopeRef = useRef25(null);
|
|
9501
9516
|
const contentId = `pimolu-context-menu-${useId22()}`;
|
|
9502
9517
|
const setOpen = useCallback11(
|
|
9503
9518
|
(next) => {
|
|
@@ -9608,7 +9623,7 @@ function ContextMenuSurface({
|
|
|
9608
9623
|
menu.contentRef,
|
|
9609
9624
|
collisionPadding
|
|
9610
9625
|
]);
|
|
9611
|
-
|
|
9626
|
+
useEffect24(() => {
|
|
9612
9627
|
if (!menu.open) return;
|
|
9613
9628
|
const panel = menu.contentRef.current;
|
|
9614
9629
|
if (!panel) return;
|
|
@@ -9682,7 +9697,7 @@ function ContextMenuContent({
|
|
|
9682
9697
|
onDismiss: () => menu.setOpen(false),
|
|
9683
9698
|
closeOnEscape: false
|
|
9684
9699
|
});
|
|
9685
|
-
|
|
9700
|
+
useEffect24(() => {
|
|
9686
9701
|
if (!menu.open) return;
|
|
9687
9702
|
function handleEscape(event) {
|
|
9688
9703
|
if (event.key !== "Escape") return;
|
|
@@ -9775,9 +9790,9 @@ import {
|
|
|
9775
9790
|
createContext as createContext14,
|
|
9776
9791
|
isValidElement as isValidElement10,
|
|
9777
9792
|
useContext as useContext14,
|
|
9778
|
-
useEffect as
|
|
9793
|
+
useEffect as useEffect25,
|
|
9779
9794
|
useId as useId23,
|
|
9780
|
-
useRef as
|
|
9795
|
+
useRef as useRef26,
|
|
9781
9796
|
useState as useState30
|
|
9782
9797
|
} from "react";
|
|
9783
9798
|
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
@@ -9812,13 +9827,13 @@ function HoverCard({
|
|
|
9812
9827
|
EXIT_DURATION6
|
|
9813
9828
|
);
|
|
9814
9829
|
const contentId = `pimolu-hover-card-${useId23()}`;
|
|
9815
|
-
const triggerRef =
|
|
9816
|
-
const contentRef =
|
|
9817
|
-
const openRef =
|
|
9818
|
-
const openTimer =
|
|
9819
|
-
const closeTimer =
|
|
9820
|
-
const skipFocusOpen =
|
|
9821
|
-
const skipFocusReset =
|
|
9830
|
+
const triggerRef = useRef26(null);
|
|
9831
|
+
const contentRef = useRef26(null);
|
|
9832
|
+
const openRef = useRef26(false);
|
|
9833
|
+
const openTimer = useRef26(null);
|
|
9834
|
+
const closeTimer = useRef26(null);
|
|
9835
|
+
const skipFocusOpen = useRef26(false);
|
|
9836
|
+
const skipFocusReset = useRef26(null);
|
|
9822
9837
|
function clearOpenTimer() {
|
|
9823
9838
|
if (openTimer.current !== null) {
|
|
9824
9839
|
clearTimeout(openTimer.current);
|
|
@@ -9915,7 +9930,7 @@ function HoverCard({
|
|
|
9915
9930
|
closeOnOutside: true,
|
|
9916
9931
|
closeOnEscape: false
|
|
9917
9932
|
});
|
|
9918
|
-
|
|
9933
|
+
useEffect25(() => {
|
|
9919
9934
|
if (!open) return;
|
|
9920
9935
|
function handleKeyDown(event) {
|
|
9921
9936
|
if (event.key !== "Escape") return;
|
|
@@ -9935,12 +9950,12 @@ function HoverCard({
|
|
|
9935
9950
|
handleKeyDown
|
|
9936
9951
|
);
|
|
9937
9952
|
}, [open]);
|
|
9938
|
-
|
|
9953
|
+
useEffect25(() => {
|
|
9939
9954
|
if (disabled) {
|
|
9940
9955
|
closeNow();
|
|
9941
9956
|
}
|
|
9942
9957
|
}, [disabled]);
|
|
9943
|
-
|
|
9958
|
+
useEffect25(() => {
|
|
9944
9959
|
return () => {
|
|
9945
9960
|
clearOpenTimer();
|
|
9946
9961
|
clearCloseTimer();
|
|
@@ -10093,10 +10108,10 @@ function HoverCardContent({
|
|
|
10093
10108
|
// command/command.tsx
|
|
10094
10109
|
import {
|
|
10095
10110
|
useCallback as useCallback12,
|
|
10096
|
-
useEffect as
|
|
10111
|
+
useEffect as useEffect26,
|
|
10097
10112
|
useId as useId24,
|
|
10098
10113
|
useMemo as useMemo6,
|
|
10099
|
-
useRef as
|
|
10114
|
+
useRef as useRef27,
|
|
10100
10115
|
useState as useState31
|
|
10101
10116
|
} from "react";
|
|
10102
10117
|
import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
@@ -10156,8 +10171,8 @@ function Command({
|
|
|
10156
10171
|
}) {
|
|
10157
10172
|
const generatedId = useId24();
|
|
10158
10173
|
const listboxId = `pimolu-command-${generatedId}`;
|
|
10159
|
-
const inputRef =
|
|
10160
|
-
const listRef =
|
|
10174
|
+
const inputRef = useRef27(null);
|
|
10175
|
+
const listRef = useRef27(null);
|
|
10161
10176
|
const [query, setQuery] = useState31("");
|
|
10162
10177
|
const [activeId, setActiveId] = useState31(
|
|
10163
10178
|
() => firstEnabledId(items)
|
|
@@ -10175,12 +10190,12 @@ function Command({
|
|
|
10175
10190
|
);
|
|
10176
10191
|
const activeOption = activeIndex >= 0 ? filteredItems[activeIndex] : void 0;
|
|
10177
10192
|
const activeDescendant = activeOption && !activeOption.disabled ? `${listboxId}-option-${activeIndex}` : void 0;
|
|
10178
|
-
|
|
10193
|
+
useEffect26(() => {
|
|
10179
10194
|
if (autoFocus) {
|
|
10180
10195
|
inputRef.current?.focus();
|
|
10181
10196
|
}
|
|
10182
10197
|
}, [autoFocus]);
|
|
10183
|
-
|
|
10198
|
+
useEffect26(() => {
|
|
10184
10199
|
const active = filteredItems.find(
|
|
10185
10200
|
(item) => item.id === activeId
|
|
10186
10201
|
);
|
|
@@ -10188,7 +10203,7 @@ function Command({
|
|
|
10188
10203
|
setActiveId(firstEnabledId(filteredItems));
|
|
10189
10204
|
}
|
|
10190
10205
|
}, [filteredItems, activeId]);
|
|
10191
|
-
|
|
10206
|
+
useEffect26(() => {
|
|
10192
10207
|
if (!activeId) return;
|
|
10193
10208
|
const node = listRef.current?.querySelector(
|
|
10194
10209
|
'[data-active="true"]'
|
|
@@ -10409,7 +10424,7 @@ function CommandPalette({
|
|
|
10409
10424
|
},
|
|
10410
10425
|
[isControlled, onOpenChange]
|
|
10411
10426
|
);
|
|
10412
|
-
|
|
10427
|
+
useEffect26(() => {
|
|
10413
10428
|
if (!shortcut) return;
|
|
10414
10429
|
const key = shortcut.toLowerCase();
|
|
10415
10430
|
function handleShortcut(event) {
|
|
@@ -11795,7 +11810,7 @@ function TimelineTime({
|
|
|
11795
11810
|
import {
|
|
11796
11811
|
forwardRef as forwardRef34,
|
|
11797
11812
|
useId as useId28,
|
|
11798
|
-
useRef as
|
|
11813
|
+
useRef as useRef28,
|
|
11799
11814
|
useState as useState33
|
|
11800
11815
|
} from "react";
|
|
11801
11816
|
import { jsx as jsx62, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
@@ -11839,7 +11854,7 @@ var Rating = forwardRef34(function Rating2({
|
|
|
11839
11854
|
const [hovered, setHovered] = useState33(
|
|
11840
11855
|
null
|
|
11841
11856
|
);
|
|
11842
|
-
const itemRefs =
|
|
11857
|
+
const itemRefs = useRef28([]);
|
|
11843
11858
|
const locked = readOnly || disabled;
|
|
11844
11859
|
const preview = hovered ?? current;
|
|
11845
11860
|
function commit(next) {
|
|
@@ -11987,9 +12002,9 @@ Rating.displayName = "PimoluRating";
|
|
|
11987
12002
|
import {
|
|
11988
12003
|
forwardRef as forwardRef35,
|
|
11989
12004
|
useCallback as useCallback13,
|
|
11990
|
-
useEffect as
|
|
12005
|
+
useEffect as useEffect27,
|
|
11991
12006
|
useId as useId29,
|
|
11992
|
-
useRef as
|
|
12007
|
+
useRef as useRef29,
|
|
11993
12008
|
useState as useState34
|
|
11994
12009
|
} from "react";
|
|
11995
12010
|
import { jsx as jsx63, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
@@ -12070,7 +12085,7 @@ var NumberInput = forwardRef35(function NumberInput2({
|
|
|
12070
12085
|
}, forwardedRef) {
|
|
12071
12086
|
const generatedId = useId29();
|
|
12072
12087
|
const inputId = id ?? `pimolu-number-input-${generatedId}`;
|
|
12073
|
-
const inputRef =
|
|
12088
|
+
const inputRef = useRef29(null);
|
|
12074
12089
|
const isControlled = value !== void 0;
|
|
12075
12090
|
const [internalValue, setInternalValue] = useState34(
|
|
12076
12091
|
() => finiteOrNull(defaultValue)
|
|
@@ -12084,7 +12099,7 @@ var NumberInput = forwardRef35(function NumberInput2({
|
|
|
12084
12099
|
() => formatNumber(currentValue, resolvedPrecision)
|
|
12085
12100
|
);
|
|
12086
12101
|
const [focused, setFocused] = useState34(false);
|
|
12087
|
-
|
|
12102
|
+
useEffect27(() => {
|
|
12088
12103
|
if (focused) return;
|
|
12089
12104
|
setDraft(
|
|
12090
12105
|
formatNumber(currentValue, resolvedPrecision)
|
|
@@ -12364,9 +12379,9 @@ NumberInput.displayName = "PimoluNumberInput";
|
|
|
12364
12379
|
// pin-input/pin-input.tsx
|
|
12365
12380
|
import {
|
|
12366
12381
|
forwardRef as forwardRef36,
|
|
12367
|
-
useEffect as
|
|
12382
|
+
useEffect as useEffect28,
|
|
12368
12383
|
useId as useId30,
|
|
12369
|
-
useRef as
|
|
12384
|
+
useRef as useRef30,
|
|
12370
12385
|
useState as useState35
|
|
12371
12386
|
} from "react";
|
|
12372
12387
|
import { jsx as jsx64, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
@@ -12412,13 +12427,13 @@ var PinInput = forwardRef36(function PinInput2({
|
|
|
12412
12427
|
const isControlled = value !== void 0;
|
|
12413
12428
|
const [internalValue, setInternalValue] = useState35(() => normalizeCells(defaultValue, count, type));
|
|
12414
12429
|
const cells = isControlled ? normalizeCells(value, count, type) : normalizeCells(internalValue, count, type);
|
|
12415
|
-
const inputsRef =
|
|
12416
|
-
const completedRef =
|
|
12417
|
-
|
|
12430
|
+
const inputsRef = useRef30([]);
|
|
12431
|
+
const completedRef = useRef30(cells.every(Boolean));
|
|
12432
|
+
useEffect28(() => {
|
|
12418
12433
|
completedRef.current = cells.every(Boolean);
|
|
12419
12434
|
}, [cells]);
|
|
12420
12435
|
const canEdit = !disabled && !readOnly && (!isControlled || Boolean(onValueChange));
|
|
12421
|
-
|
|
12436
|
+
useEffect28(() => {
|
|
12422
12437
|
if (!autoFocus || disabled) return;
|
|
12423
12438
|
const firstEmpty = cells.findIndex((cell) => !cell);
|
|
12424
12439
|
const node = inputsRef.current[firstEmpty === -1 ? 0 : firstEmpty];
|
|
@@ -12644,7 +12659,7 @@ import {
|
|
|
12644
12659
|
forwardRef as forwardRef37,
|
|
12645
12660
|
useCallback as useCallback14,
|
|
12646
12661
|
useId as useId31,
|
|
12647
|
-
useRef as
|
|
12662
|
+
useRef as useRef31,
|
|
12648
12663
|
useState as useState36
|
|
12649
12664
|
} from "react";
|
|
12650
12665
|
import { jsx as jsx65, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
@@ -12694,7 +12709,7 @@ var TagsInput = forwardRef37(function TagsInput2({
|
|
|
12694
12709
|
const [internalTags, setInternalTags] = useState36(() => normalizeTags(defaultValue ?? []));
|
|
12695
12710
|
const tags = (isControlled ? value ?? [] : internalTags).filter((tag) => tag.trim() !== "");
|
|
12696
12711
|
const [draft, setDraft] = useState36("");
|
|
12697
|
-
const inputRef =
|
|
12712
|
+
const inputRef = useRef31(null);
|
|
12698
12713
|
const setInputRef = useCallback14(
|
|
12699
12714
|
(node) => {
|
|
12700
12715
|
inputRef.current = node;
|
|
@@ -12932,7 +12947,7 @@ import {
|
|
|
12932
12947
|
forwardRef as forwardRef38,
|
|
12933
12948
|
useCallback as useCallback15,
|
|
12934
12949
|
useId as useId32,
|
|
12935
|
-
useRef as
|
|
12950
|
+
useRef as useRef32,
|
|
12936
12951
|
useState as useState37
|
|
12937
12952
|
} from "react";
|
|
12938
12953
|
import { jsx as jsx66, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
@@ -12971,7 +12986,7 @@ var TimePicker = forwardRef38(function TimePicker2({
|
|
|
12971
12986
|
}, forwardedRef) {
|
|
12972
12987
|
const generatedId = useId32();
|
|
12973
12988
|
const inputId = id ?? `pimolu-time-picker-${generatedId}`;
|
|
12974
|
-
const inputRef =
|
|
12989
|
+
const inputRef = useRef32(null);
|
|
12975
12990
|
const isControlled = value !== void 0;
|
|
12976
12991
|
const [internalValue, setInternalValue] = useState37(() => normalizeTime(defaultValue));
|
|
12977
12992
|
const currentValue = isControlled ? normalizeTime(value) : internalValue;
|
|
@@ -13115,10 +13130,10 @@ TimePicker.displayName = "PimoluTimePicker";
|
|
|
13115
13130
|
|
|
13116
13131
|
// calendar/calendar.tsx
|
|
13117
13132
|
import {
|
|
13118
|
-
useEffect as
|
|
13133
|
+
useEffect as useEffect29,
|
|
13119
13134
|
useId as useId33,
|
|
13120
13135
|
useMemo as useMemo8,
|
|
13121
|
-
useRef as
|
|
13136
|
+
useRef as useRef33,
|
|
13122
13137
|
useState as useState38
|
|
13123
13138
|
} from "react";
|
|
13124
13139
|
import { jsx as jsx67, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
@@ -13269,7 +13284,7 @@ function Calendar({
|
|
|
13269
13284
|
}) {
|
|
13270
13285
|
const generatedId = useId33();
|
|
13271
13286
|
const instructionsId = `pimolu-calendar-${generatedId}-instructions`;
|
|
13272
|
-
const rootRef =
|
|
13287
|
+
const rootRef = useRef33(null);
|
|
13273
13288
|
const monthControlled = month !== void 0;
|
|
13274
13289
|
const selectedControlled = selected !== void 0;
|
|
13275
13290
|
const rangeControlled = range !== void 0;
|
|
@@ -13287,7 +13302,7 @@ function Calendar({
|
|
|
13287
13302
|
const seed = selected ?? range?.from ?? /* @__PURE__ */ new Date();
|
|
13288
13303
|
return isSameMonth(seed, initialMonth) ? startOfDay(seed) : startOfDay(initialMonth);
|
|
13289
13304
|
});
|
|
13290
|
-
const pendingFocus =
|
|
13305
|
+
const pendingFocus = useRef33(null);
|
|
13291
13306
|
const visibleMonthKey = `${visibleMonth.getFullYear()}-${visibleMonth.getMonth()}`;
|
|
13292
13307
|
const monthFormatter = useMemo8(
|
|
13293
13308
|
() => new Intl.DateTimeFormat(locale, {
|
|
@@ -13370,7 +13385,7 @@ function Calendar({
|
|
|
13370
13385
|
addMonthsToFirst(visibleMonth, amount)
|
|
13371
13386
|
);
|
|
13372
13387
|
}
|
|
13373
|
-
|
|
13388
|
+
useEffect29(() => {
|
|
13374
13389
|
const requested = pendingFocus.current;
|
|
13375
13390
|
if (!requested) return;
|
|
13376
13391
|
const element = rootRef.current?.querySelector(
|
|
@@ -13380,7 +13395,7 @@ function Calendar({
|
|
|
13380
13395
|
element.focus();
|
|
13381
13396
|
pendingFocus.current = null;
|
|
13382
13397
|
}, [focusedDate, visibleMonthKey, numberOfMonths]);
|
|
13383
|
-
|
|
13398
|
+
useEffect29(() => {
|
|
13384
13399
|
const displayed = monthsFrom(visibleMonth, numberOfMonths);
|
|
13385
13400
|
if (displayed.some((entry) => isSameMonth(focusedDate, entry))) {
|
|
13386
13401
|
return;
|
|
@@ -13653,10 +13668,10 @@ function Calendar({
|
|
|
13653
13668
|
import {
|
|
13654
13669
|
forwardRef as forwardRef39,
|
|
13655
13670
|
useCallback as useCallback16,
|
|
13656
|
-
useEffect as
|
|
13671
|
+
useEffect as useEffect30,
|
|
13657
13672
|
useId as useId34,
|
|
13658
13673
|
useMemo as useMemo9,
|
|
13659
|
-
useRef as
|
|
13674
|
+
useRef as useRef34,
|
|
13660
13675
|
useState as useState39
|
|
13661
13676
|
} from "react";
|
|
13662
13677
|
import { jsx as jsx68, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
@@ -13713,9 +13728,9 @@ var DatePicker = forwardRef39(function DatePicker2({
|
|
|
13713
13728
|
const labelId = `${triggerId}-label`;
|
|
13714
13729
|
const valueId = `${triggerId}-value`;
|
|
13715
13730
|
const panelId = `${triggerId}-panel`;
|
|
13716
|
-
const fieldRef =
|
|
13717
|
-
const triggerRef =
|
|
13718
|
-
const panelRef =
|
|
13731
|
+
const fieldRef = useRef34(null);
|
|
13732
|
+
const triggerRef = useRef34(null);
|
|
13733
|
+
const panelRef = useRef34(null);
|
|
13719
13734
|
const isControlled = value !== void 0;
|
|
13720
13735
|
const [internalValue, setInternalValue] = useState39(defaultValue);
|
|
13721
13736
|
const [open, setOpen] = useState39(false);
|
|
@@ -13777,7 +13792,7 @@ var DatePicker = forwardRef39(function DatePicker2({
|
|
|
13777
13792
|
setOpen(false);
|
|
13778
13793
|
triggerRef.current?.focus();
|
|
13779
13794
|
}
|
|
13780
|
-
|
|
13795
|
+
useEffect30(() => {
|
|
13781
13796
|
if (!open) return;
|
|
13782
13797
|
function handleKeyDown(event) {
|
|
13783
13798
|
if (event.key !== "Escape") return;
|
|
@@ -13788,7 +13803,7 @@ var DatePicker = forwardRef39(function DatePicker2({
|
|
|
13788
13803
|
document.addEventListener("keydown", handleKeyDown);
|
|
13789
13804
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
13790
13805
|
}, [open]);
|
|
13791
|
-
|
|
13806
|
+
useEffect30(() => {
|
|
13792
13807
|
if (!open) return;
|
|
13793
13808
|
function handleFocusIn(event) {
|
|
13794
13809
|
const target = event.target;
|
|
@@ -13961,10 +13976,10 @@ DatePicker.displayName = "PimoluDatePicker";
|
|
|
13961
13976
|
import {
|
|
13962
13977
|
forwardRef as forwardRef40,
|
|
13963
13978
|
useCallback as useCallback17,
|
|
13964
|
-
useEffect as
|
|
13979
|
+
useEffect as useEffect31,
|
|
13965
13980
|
useId as useId35,
|
|
13966
13981
|
useMemo as useMemo10,
|
|
13967
|
-
useRef as
|
|
13982
|
+
useRef as useRef35,
|
|
13968
13983
|
useState as useState40
|
|
13969
13984
|
} from "react";
|
|
13970
13985
|
import { Fragment as Fragment8, jsx as jsx69, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
@@ -14057,9 +14072,9 @@ var DateRangePicker = forwardRef40(function DateRangePicker2({
|
|
|
14057
14072
|
const labelId = `${triggerId}-label`;
|
|
14058
14073
|
const valueId = `${triggerId}-value`;
|
|
14059
14074
|
const panelId = `${triggerId}-panel`;
|
|
14060
|
-
const fieldRef =
|
|
14061
|
-
const triggerRef =
|
|
14062
|
-
const panelRef =
|
|
14075
|
+
const fieldRef = useRef35(null);
|
|
14076
|
+
const triggerRef = useRef35(null);
|
|
14077
|
+
const panelRef = useRef35(null);
|
|
14063
14078
|
const isControlled = value !== void 0;
|
|
14064
14079
|
const [internalRange, setInternalRange] = useState40(
|
|
14065
14080
|
() => normalizeRange(defaultValue ?? EMPTY_RANGE)
|
|
@@ -14131,7 +14146,7 @@ var DateRangePicker = forwardRef40(function DateRangePicker2({
|
|
|
14131
14146
|
setOpen(false);
|
|
14132
14147
|
triggerRef.current?.focus();
|
|
14133
14148
|
}
|
|
14134
|
-
|
|
14149
|
+
useEffect31(() => {
|
|
14135
14150
|
if (!open) return;
|
|
14136
14151
|
function handleKeyDown(event) {
|
|
14137
14152
|
if (event.key !== "Escape") return;
|
|
@@ -14142,7 +14157,7 @@ var DateRangePicker = forwardRef40(function DateRangePicker2({
|
|
|
14142
14157
|
document.addEventListener("keydown", handleKeyDown);
|
|
14143
14158
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
14144
14159
|
}, [open]);
|
|
14145
|
-
|
|
14160
|
+
useEffect31(() => {
|
|
14146
14161
|
if (!open) return;
|
|
14147
14162
|
function handleFocusIn(event) {
|
|
14148
14163
|
const target = event.target;
|
|
@@ -14367,13 +14382,13 @@ DateRangePicker.displayName = "PimoluDateRangePicker";
|
|
|
14367
14382
|
import {
|
|
14368
14383
|
forwardRef as forwardRef41,
|
|
14369
14384
|
useId as useId36,
|
|
14370
|
-
useRef as
|
|
14385
|
+
useRef as useRef36,
|
|
14371
14386
|
useState as useState42
|
|
14372
14387
|
} from "react";
|
|
14373
14388
|
|
|
14374
14389
|
// internal/file-preview.tsx
|
|
14375
14390
|
import {
|
|
14376
|
-
useEffect as
|
|
14391
|
+
useEffect as useEffect32,
|
|
14377
14392
|
useState as useState41
|
|
14378
14393
|
} from "react";
|
|
14379
14394
|
import { jsx as jsx70, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
@@ -14383,7 +14398,7 @@ function isImageFile(file) {
|
|
|
14383
14398
|
}
|
|
14384
14399
|
function useFilePreviewUrl(file) {
|
|
14385
14400
|
const [url, setUrl] = useState41(null);
|
|
14386
|
-
|
|
14401
|
+
useEffect32(() => {
|
|
14387
14402
|
if (!isImageFile(file) || typeof URL === "undefined" || typeof URL.createObjectURL !== "function") {
|
|
14388
14403
|
setUrl(null);
|
|
14389
14404
|
return;
|
|
@@ -14403,7 +14418,7 @@ function FilePreview({
|
|
|
14403
14418
|
}) {
|
|
14404
14419
|
const url = useFilePreviewUrl(file);
|
|
14405
14420
|
const [failed, setFailed] = useState41(false);
|
|
14406
|
-
|
|
14421
|
+
useEffect32(() => {
|
|
14407
14422
|
setFailed(false);
|
|
14408
14423
|
}, [url]);
|
|
14409
14424
|
if (url && !failed) {
|
|
@@ -14571,7 +14586,7 @@ var FileUpload = forwardRef41(function FileUpload2({
|
|
|
14571
14586
|
const descriptionId = `${inputId}-description`;
|
|
14572
14587
|
const errorId = `${inputId}-error`;
|
|
14573
14588
|
const buttonTextId = `${inputId}-button-text`;
|
|
14574
|
-
const inputRef =
|
|
14589
|
+
const inputRef = useRef36(null);
|
|
14575
14590
|
const isControlled = files !== void 0;
|
|
14576
14591
|
const [internalFiles, setInternalFiles] = useState42(
|
|
14577
14592
|
() => defaultFiles ?? []
|
|
@@ -14840,7 +14855,7 @@ FileUpload.displayName = "PimoluFileUpload";
|
|
|
14840
14855
|
import {
|
|
14841
14856
|
forwardRef as forwardRef42,
|
|
14842
14857
|
useId as useId37,
|
|
14843
|
-
useRef as
|
|
14858
|
+
useRef as useRef37,
|
|
14844
14859
|
useState as useState43
|
|
14845
14860
|
} from "react";
|
|
14846
14861
|
import { jsx as jsx72, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -14971,8 +14986,8 @@ var Dropzone = forwardRef42(function Dropzone2({
|
|
|
14971
14986
|
const hintId = `${inputId}-hint`;
|
|
14972
14987
|
const descriptionId = `${inputId}-description`;
|
|
14973
14988
|
const errorId = `${inputId}-error`;
|
|
14974
|
-
const inputRef =
|
|
14975
|
-
const dragDepth =
|
|
14989
|
+
const inputRef = useRef37(null);
|
|
14990
|
+
const dragDepth = useRef37(0);
|
|
14976
14991
|
const [dragging, setDragging] = useState43(false);
|
|
14977
14992
|
const isControlled = files !== void 0;
|
|
14978
14993
|
const [internalFiles, setInternalFiles] = useState43(
|
|
@@ -15299,9 +15314,9 @@ Dropzone.displayName = "PimoluDropzone";
|
|
|
15299
15314
|
// color-picker/color-picker.tsx
|
|
15300
15315
|
import {
|
|
15301
15316
|
forwardRef as forwardRef43,
|
|
15302
|
-
useEffect as
|
|
15317
|
+
useEffect as useEffect33,
|
|
15303
15318
|
useId as useId38,
|
|
15304
|
-
useRef as
|
|
15319
|
+
useRef as useRef38,
|
|
15305
15320
|
useState as useState44
|
|
15306
15321
|
} from "react";
|
|
15307
15322
|
import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
@@ -15366,7 +15381,7 @@ var ColorPicker = forwardRef43(function ColorPicker2({
|
|
|
15366
15381
|
const hexErrorId = `pimolu-color-picker-${generatedId}-hex-error`;
|
|
15367
15382
|
const hintId = `pimolu-color-picker-${generatedId}-hint`;
|
|
15368
15383
|
const presetsTitleId = `pimolu-color-picker-${generatedId}-presets-title`;
|
|
15369
|
-
const triggerRef =
|
|
15384
|
+
const triggerRef = useRef38(null);
|
|
15370
15385
|
const isControlled = value !== void 0;
|
|
15371
15386
|
const [internalValue, setInternalValue] = useState44(
|
|
15372
15387
|
() => resolveColor(defaultValue)
|
|
@@ -15383,7 +15398,7 @@ var ColorPicker = forwardRef43(function ColorPicker2({
|
|
|
15383
15398
|
presets.map((preset) => normalizeHexColor(preset)).filter((preset) => Boolean(preset))
|
|
15384
15399
|
)
|
|
15385
15400
|
);
|
|
15386
|
-
|
|
15401
|
+
useEffect33(() => {
|
|
15387
15402
|
if (open) return;
|
|
15388
15403
|
setDraft(normalizedValue);
|
|
15389
15404
|
setHexError(null);
|
|
@@ -16293,9 +16308,9 @@ VisuallyHidden.displayName = "PimoluVisuallyHidden";
|
|
|
16293
16308
|
import {
|
|
16294
16309
|
forwardRef as forwardRef53,
|
|
16295
16310
|
useCallback as useCallback18,
|
|
16296
|
-
useEffect as
|
|
16311
|
+
useEffect as useEffect34,
|
|
16297
16312
|
useMemo as useMemo11,
|
|
16298
|
-
useRef as
|
|
16313
|
+
useRef as useRef39
|
|
16299
16314
|
} from "react";
|
|
16300
16315
|
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
16301
16316
|
var FocusScope = forwardRef53(function FocusScope2({
|
|
@@ -16310,8 +16325,8 @@ var FocusScope = forwardRef53(function FocusScope2({
|
|
|
16310
16325
|
children,
|
|
16311
16326
|
...props
|
|
16312
16327
|
}, forwardedRef) {
|
|
16313
|
-
const containerRef =
|
|
16314
|
-
const restoreFocusRef =
|
|
16328
|
+
const containerRef = useRef39(null);
|
|
16329
|
+
const restoreFocusRef = useRef39(restoreFocus);
|
|
16315
16330
|
restoreFocusRef.current = restoreFocus;
|
|
16316
16331
|
const setRef = useCallback18(
|
|
16317
16332
|
(node) => {
|
|
@@ -16339,7 +16354,7 @@ var FocusScope = forwardRef53(function FocusScope2({
|
|
|
16339
16354
|
returnFocusRef,
|
|
16340
16355
|
initialFocus
|
|
16341
16356
|
});
|
|
16342
|
-
|
|
16357
|
+
useEffect34(() => {
|
|
16343
16358
|
if (!active || trapped) return;
|
|
16344
16359
|
const container = containerRef.current;
|
|
16345
16360
|
if (!container) return;
|
|
@@ -16378,8 +16393,8 @@ FocusScope.displayName = "PimoluFocusScope";
|
|
|
16378
16393
|
import {
|
|
16379
16394
|
forwardRef as forwardRef54,
|
|
16380
16395
|
useCallback as useCallback19,
|
|
16381
|
-
useEffect as
|
|
16382
|
-
useRef as
|
|
16396
|
+
useEffect as useEffect35,
|
|
16397
|
+
useRef as useRef40,
|
|
16383
16398
|
useState as useState45
|
|
16384
16399
|
} from "react";
|
|
16385
16400
|
import { jsx as jsx84, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
@@ -16423,7 +16438,7 @@ var Image2 = forwardRef54(function Image3({
|
|
|
16423
16438
|
onError,
|
|
16424
16439
|
...props
|
|
16425
16440
|
}, ref) {
|
|
16426
|
-
const imageRef =
|
|
16441
|
+
const imageRef = useRef40(null);
|
|
16427
16442
|
const attachRef = useCallback19((node) => {
|
|
16428
16443
|
imageRef.current = node;
|
|
16429
16444
|
if (typeof ref === "function") return ref(node);
|
|
@@ -16433,7 +16448,7 @@ var Image2 = forwardRef54(function Image3({
|
|
|
16433
16448
|
const [fallbackFor, setFallbackFor] = useState45(null);
|
|
16434
16449
|
const usingFallback = Boolean(fallbackSrc) && fallbackSrc !== src && fallbackFor === src;
|
|
16435
16450
|
const activeSrc = usingFallback ? fallbackSrc : src;
|
|
16436
|
-
|
|
16451
|
+
useEffect35(() => {
|
|
16437
16452
|
const image = imageRef.current;
|
|
16438
16453
|
if (image?.complete && image.naturalWidth > 0) {
|
|
16439
16454
|
setLoadedImage((current) => current?.src === activeSrc && current.status === "loaded" ? current : { src: activeSrc, status: "loaded" });
|
|
@@ -16522,9 +16537,9 @@ import {
|
|
|
16522
16537
|
Children as Children5,
|
|
16523
16538
|
forwardRef as forwardRef55,
|
|
16524
16539
|
useCallback as useCallback20,
|
|
16525
|
-
useEffect as
|
|
16540
|
+
useEffect as useEffect36,
|
|
16526
16541
|
useMemo as useMemo12,
|
|
16527
|
-
useRef as
|
|
16542
|
+
useRef as useRef41,
|
|
16528
16543
|
useState as useState46
|
|
16529
16544
|
} from "react";
|
|
16530
16545
|
import { Fragment as Fragment11, jsx as jsx85, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
@@ -16627,12 +16642,12 @@ var Carousel = forwardRef55(function Carousel2({
|
|
|
16627
16642
|
count,
|
|
16628
16643
|
loop
|
|
16629
16644
|
);
|
|
16630
|
-
const currentIndexRef =
|
|
16645
|
+
const currentIndexRef = useRef41(currentIndex);
|
|
16631
16646
|
currentIndexRef.current = currentIndex;
|
|
16632
|
-
const trackRef =
|
|
16647
|
+
const trackRef = useRef41(
|
|
16633
16648
|
null
|
|
16634
16649
|
);
|
|
16635
|
-
const scrollTimerRef =
|
|
16650
|
+
const scrollTimerRef = useRef41(
|
|
16636
16651
|
null
|
|
16637
16652
|
);
|
|
16638
16653
|
const [interacting, setInteracting] = useState46(false);
|
|
@@ -16656,14 +16671,14 @@ var Carousel = forwardRef55(function Carousel2({
|
|
|
16656
16671
|
},
|
|
16657
16672
|
[count, loop, controlled, onIndexChange]
|
|
16658
16673
|
);
|
|
16659
|
-
|
|
16674
|
+
useEffect36(() => {
|
|
16660
16675
|
const track = trackRef.current;
|
|
16661
16676
|
if (!track) return;
|
|
16662
16677
|
const slide = track.children[currentIndex];
|
|
16663
16678
|
if (!slide) return;
|
|
16664
16679
|
track.scrollLeft = slide.offsetLeft;
|
|
16665
16680
|
}, [currentIndex, count]);
|
|
16666
|
-
|
|
16681
|
+
useEffect36(() => {
|
|
16667
16682
|
if (!autoPlay || count <= 1 || isPaused) {
|
|
16668
16683
|
return;
|
|
16669
16684
|
}
|
|
@@ -16683,7 +16698,7 @@ var Carousel = forwardRef55(function Carousel2({
|
|
|
16683
16698
|
isPaused,
|
|
16684
16699
|
commit
|
|
16685
16700
|
]);
|
|
16686
|
-
|
|
16701
|
+
useEffect36(() => {
|
|
16687
16702
|
return () => {
|
|
16688
16703
|
if (scrollTimerRef.current !== null) {
|
|
16689
16704
|
window.clearTimeout(
|
|
@@ -16890,7 +16905,7 @@ import {
|
|
|
16890
16905
|
forwardRef as forwardRef56,
|
|
16891
16906
|
useCallback as useCallback21,
|
|
16892
16907
|
useId as useId39,
|
|
16893
|
-
useRef as
|
|
16908
|
+
useRef as useRef42,
|
|
16894
16909
|
useState as useState47
|
|
16895
16910
|
} from "react";
|
|
16896
16911
|
import { jsx as jsx86, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
@@ -16975,10 +16990,10 @@ var Resizable = forwardRef56(function Resizable2({
|
|
|
16975
16990
|
lowerFirst,
|
|
16976
16991
|
upperFirst
|
|
16977
16992
|
);
|
|
16978
|
-
const rootRef =
|
|
16993
|
+
const rootRef = useRef42(
|
|
16979
16994
|
null
|
|
16980
16995
|
);
|
|
16981
|
-
const dragRef =
|
|
16996
|
+
const dragRef = useRef42(null);
|
|
16982
16997
|
const [dragging, setDragging] = useState47(false);
|
|
16983
16998
|
const assignRootRef = useCallback21(
|
|
16984
16999
|
(node) => {
|
|
@@ -17375,7 +17390,7 @@ import {
|
|
|
17375
17390
|
Fragment as Fragment12,
|
|
17376
17391
|
useId as useId40,
|
|
17377
17392
|
useMemo as useMemo13,
|
|
17378
|
-
useRef as
|
|
17393
|
+
useRef as useRef43,
|
|
17379
17394
|
useState as useState49
|
|
17380
17395
|
} from "react";
|
|
17381
17396
|
import { jsx as jsx89, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
@@ -17602,7 +17617,7 @@ function DataGrid({
|
|
|
17602
17617
|
const [internalWidths, setInternalWidths] = useState49(() => ({ ...defaultColumnWidths ?? {} }));
|
|
17603
17618
|
const [collapsedGroups, setCollapsedGroups] = useState49(() => new Set(defaultCollapsedGroups ?? []));
|
|
17604
17619
|
const [resizingId, setResizingId] = useState49(null);
|
|
17605
|
-
const dragRef =
|
|
17620
|
+
const dragRef = useRef43(null);
|
|
17606
17621
|
const isFilterControlled = controlledFilter !== void 0;
|
|
17607
17622
|
const filterValue = isFilterControlled ? controlledFilter : internalFilter;
|
|
17608
17623
|
const isSortControlled = controlledSort !== void 0;
|
|
@@ -18382,9 +18397,9 @@ function ColumnsIcon() {
|
|
|
18382
18397
|
|
|
18383
18398
|
// tree-table/tree-table.tsx
|
|
18384
18399
|
import {
|
|
18385
|
-
useEffect as
|
|
18400
|
+
useEffect as useEffect37,
|
|
18386
18401
|
useMemo as useMemo14,
|
|
18387
|
-
useRef as
|
|
18402
|
+
useRef as useRef44,
|
|
18388
18403
|
useState as useState50
|
|
18389
18404
|
} from "react";
|
|
18390
18405
|
import { jsx as jsx90, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
@@ -18469,6 +18484,24 @@ function collectParentIds(nodes, getNodeId) {
|
|
|
18469
18484
|
walk(nodes);
|
|
18470
18485
|
return ids;
|
|
18471
18486
|
}
|
|
18487
|
+
function selectableBranch(node, getId) {
|
|
18488
|
+
return [
|
|
18489
|
+
...node.disabled ? [] : [getId(node)],
|
|
18490
|
+
...(node.children ?? []).flatMap((child) => selectableBranch(child, getId))
|
|
18491
|
+
];
|
|
18492
|
+
}
|
|
18493
|
+
function deriveParentSelection(nodes, selected, getId) {
|
|
18494
|
+
for (const node of nodes) {
|
|
18495
|
+
const children = node.children ?? [];
|
|
18496
|
+
deriveParentSelection(children, selected, getId);
|
|
18497
|
+
const descendants = children.flatMap((child) => selectableBranch(child, getId));
|
|
18498
|
+
if (!node.disabled && descendants.length) {
|
|
18499
|
+
if (descendants.every((id) => selected.has(id))) selected.add(getId(node));
|
|
18500
|
+
else selected.delete(getId(node));
|
|
18501
|
+
}
|
|
18502
|
+
}
|
|
18503
|
+
return selected;
|
|
18504
|
+
}
|
|
18472
18505
|
function getDefaultNodeId(node) {
|
|
18473
18506
|
return node.id;
|
|
18474
18507
|
}
|
|
@@ -18500,6 +18533,7 @@ function TreeTable({
|
|
|
18500
18533
|
defaultExpandAll = false,
|
|
18501
18534
|
onExpandedChange,
|
|
18502
18535
|
selectable = false,
|
|
18536
|
+
selectionMode = "independent",
|
|
18503
18537
|
selectedIds: controlledSelectedIds,
|
|
18504
18538
|
defaultSelectedIds,
|
|
18505
18539
|
onSelectionChange,
|
|
@@ -18509,7 +18543,7 @@ function TreeTable({
|
|
|
18509
18543
|
className,
|
|
18510
18544
|
rowClassName
|
|
18511
18545
|
}) {
|
|
18512
|
-
const text = { ...DEFAULT_LABELS3, ...labels };
|
|
18546
|
+
const text = { ...DEFAULT_LABELS3, ...selectionMode === "cascade" ? { selectAll: "Select all rows" } : {}, ...labels };
|
|
18513
18547
|
const resolveNodeId = getNodeId ?? getDefaultNodeId;
|
|
18514
18548
|
const [internalExpandedIds, setInternalExpandedIds] = useState50(() => {
|
|
18515
18549
|
const initial = new Set(defaultExpandedIds ?? []);
|
|
@@ -18531,10 +18565,20 @@ function TreeTable({
|
|
|
18531
18565
|
]);
|
|
18532
18566
|
const isSelectionControlled = controlledSelectedIds !== void 0;
|
|
18533
18567
|
const selectedIds = isSelectionControlled ? [...controlledSelectedIds] : internalSelectedIds;
|
|
18534
|
-
const selected = useMemo14(
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18568
|
+
const selected = useMemo14(() => {
|
|
18569
|
+
const result = new Set(selectedIds);
|
|
18570
|
+
if (selectionMode === "independent") return result;
|
|
18571
|
+
function expandBranches(items) {
|
|
18572
|
+
for (const node of items) {
|
|
18573
|
+
if (result.has(resolveNodeId(node)) && !node.disabled) {
|
|
18574
|
+
selectableBranch(node, resolveNodeId).forEach((id) => result.add(id));
|
|
18575
|
+
}
|
|
18576
|
+
expandBranches(node.children ?? []);
|
|
18577
|
+
}
|
|
18578
|
+
}
|
|
18579
|
+
expandBranches(nodes);
|
|
18580
|
+
return deriveParentSelection(nodes, result, resolveNodeId);
|
|
18581
|
+
}, [selectedIds, nodes, resolveNodeId, selectionMode]);
|
|
18538
18582
|
const allNodeIds = useMemo14(
|
|
18539
18583
|
() => collectNodeIds(nodes, resolveNodeId),
|
|
18540
18584
|
[nodes, resolveNodeId]
|
|
@@ -18550,10 +18594,10 @@ function TreeTable({
|
|
|
18550
18594
|
const [focusedId, setFocusedId] = useState50(
|
|
18551
18595
|
() => selectedIds[0] ?? nodes.find((node) => !node.disabled)?.id
|
|
18552
18596
|
);
|
|
18553
|
-
const rowRefs =
|
|
18597
|
+
const rowRefs = useRef44(
|
|
18554
18598
|
/* @__PURE__ */ new Map()
|
|
18555
18599
|
);
|
|
18556
|
-
|
|
18600
|
+
useEffect37(() => {
|
|
18557
18601
|
if (focusedId && visibleRows.some((row) => row.id === focusedId)) {
|
|
18558
18602
|
return;
|
|
18559
18603
|
}
|
|
@@ -18597,6 +18641,7 @@ function TreeTable({
|
|
|
18597
18641
|
setExpansion(id, !expanded.has(id));
|
|
18598
18642
|
}
|
|
18599
18643
|
function commitSelection(next) {
|
|
18644
|
+
if (selectionMode === "cascade") deriveParentSelection(nodes, next, resolveNodeId);
|
|
18600
18645
|
const known = new Set(allNodeIds);
|
|
18601
18646
|
const ordered = [
|
|
18602
18647
|
...allNodeIds.filter((id) => next.has(id)),
|
|
@@ -18613,19 +18658,23 @@ function TreeTable({
|
|
|
18613
18658
|
)?.node;
|
|
18614
18659
|
if (node?.disabled) return;
|
|
18615
18660
|
const next = new Set(selected);
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
next.
|
|
18620
|
-
|
|
18661
|
+
const ids = selectionMode === "cascade" && node ? selectableBranch(node, resolveNodeId) : [id];
|
|
18662
|
+
const remove = ids.every((entry) => next.has(entry));
|
|
18663
|
+
ids.forEach((entry) => {
|
|
18664
|
+
if (remove) next.delete(entry);
|
|
18665
|
+
else next.add(entry);
|
|
18666
|
+
});
|
|
18621
18667
|
commitSelection(next);
|
|
18622
18668
|
}
|
|
18623
18669
|
function selectedVisibleCount() {
|
|
18624
|
-
return
|
|
18670
|
+
return selectableVisibleRows().filter(
|
|
18625
18671
|
(row) => !row.node.disabled && selected.has(row.id)
|
|
18626
18672
|
).length;
|
|
18627
18673
|
}
|
|
18628
18674
|
function selectableVisibleRows() {
|
|
18675
|
+
if (selectionMode === "cascade") {
|
|
18676
|
+
return flattenVisible(nodes, new Set(allNodeIds), resolveNodeId).filter((row) => !row.node.disabled);
|
|
18677
|
+
}
|
|
18629
18678
|
return visibleRows.filter(
|
|
18630
18679
|
(row) => !row.node.disabled
|
|
18631
18680
|
);
|
|
@@ -18807,6 +18856,7 @@ function TreeTable({
|
|
|
18807
18856
|
const label = getNodeLabelText(node);
|
|
18808
18857
|
const isExpanded = expanded.has(id);
|
|
18809
18858
|
const isSelected = selected.has(id);
|
|
18859
|
+
const mixed = selectionMode === "cascade" && !isSelected && selectableBranch(node, resolveNodeId).some((entry) => selected.has(entry));
|
|
18810
18860
|
const isDisabled = Boolean(node.disabled);
|
|
18811
18861
|
return /* @__PURE__ */ jsxs66(
|
|
18812
18862
|
TableRow,
|
|
@@ -18849,6 +18899,7 @@ function TreeTable({
|
|
|
18849
18899
|
{
|
|
18850
18900
|
"aria-label": text.selectRow(label),
|
|
18851
18901
|
checked: isSelected,
|
|
18902
|
+
indeterminate: mixed,
|
|
18852
18903
|
disabled: isDisabled,
|
|
18853
18904
|
onCheckedChange: () => toggleSelection(id)
|
|
18854
18905
|
}
|
|
@@ -18954,7 +19005,12 @@ function Chevron7() {
|
|
|
18954
19005
|
|
|
18955
19006
|
// chart/chart.tsx
|
|
18956
19007
|
import {
|
|
18957
|
-
forwardRef as forwardRef58
|
|
19008
|
+
forwardRef as forwardRef58,
|
|
19009
|
+
useId as useId41,
|
|
19010
|
+
useRef as useRef45,
|
|
19011
|
+
useState as useState51,
|
|
19012
|
+
useEffect as useEffect38,
|
|
19013
|
+
useImperativeHandle
|
|
18958
19014
|
} from "react";
|
|
18959
19015
|
import { Fragment as Fragment13, jsx as jsx91, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
18960
19016
|
var DEFAULT_WIDTH = 640;
|
|
@@ -18993,6 +19049,21 @@ function safeValue(value) {
|
|
|
18993
19049
|
function safeSize(value, fallback) {
|
|
18994
19050
|
return value != null && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
18995
19051
|
}
|
|
19052
|
+
function useCartesianViewport(width, forwardedRef, responsive) {
|
|
19053
|
+
const containerRef = useRef45(null);
|
|
19054
|
+
const [measuredWidth, setMeasuredWidth] = useState51(0);
|
|
19055
|
+
useImperativeHandle(forwardedRef, () => containerRef.current, []);
|
|
19056
|
+
useEffect38(() => {
|
|
19057
|
+
const node = containerRef.current;
|
|
19058
|
+
if (!responsive || !node || typeof ResizeObserver === "undefined") return;
|
|
19059
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
19060
|
+
if (entry.contentRect.width > 0) setMeasuredWidth(Math.round(entry.contentRect.width));
|
|
19061
|
+
});
|
|
19062
|
+
observer.observe(node);
|
|
19063
|
+
return () => observer.disconnect();
|
|
19064
|
+
}, [responsive]);
|
|
19065
|
+
return { containerRef, width: responsive && measuredWidth > 0 ? measuredWidth : safeSize(width, DEFAULT_WIDTH) };
|
|
19066
|
+
}
|
|
18996
19067
|
function round2(value) {
|
|
18997
19068
|
return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : 0;
|
|
18998
19069
|
}
|
|
@@ -19018,6 +19089,9 @@ function buildTicks(minimum, maximum) {
|
|
|
19018
19089
|
(_, index) => minimum + span * index / 4
|
|
19019
19090
|
);
|
|
19020
19091
|
}
|
|
19092
|
+
function valueAxisWidth(ticks, formatter) {
|
|
19093
|
+
return Math.max(48, ...ticks.map((tick) => formatter(tick).length * 8 + 16));
|
|
19094
|
+
}
|
|
19021
19095
|
function describeRange(values, formatter) {
|
|
19022
19096
|
const finite = values.filter(
|
|
19023
19097
|
(value) => Number.isFinite(value)
|
|
@@ -19040,9 +19114,31 @@ function ChartContainer({
|
|
|
19040
19114
|
emptyLabel,
|
|
19041
19115
|
legend,
|
|
19042
19116
|
table,
|
|
19117
|
+
exploration,
|
|
19043
19118
|
children,
|
|
19044
19119
|
...props
|
|
19045
19120
|
}) {
|
|
19121
|
+
const [activeIndex, setActiveIndex] = useState51(null);
|
|
19122
|
+
const [keyboard, setKeyboard] = useState51(false);
|
|
19123
|
+
const pointerFocus = useRef45(false);
|
|
19124
|
+
const dismissedIndex = useRef45(null);
|
|
19125
|
+
const instructionsId = useId41();
|
|
19126
|
+
const tooltipId = useId41();
|
|
19127
|
+
const active = activeIndex == null ? void 0 : exploration?.items[activeIndex];
|
|
19128
|
+
function explorePointer(event) {
|
|
19129
|
+
if (!exploration?.items.length || event.target.closest(".pimolu-chart__tooltip")) return;
|
|
19130
|
+
setKeyboard(false);
|
|
19131
|
+
if (exploration.axis === "segment") {
|
|
19132
|
+
const segment = event.target.closest("[data-chart-index]");
|
|
19133
|
+
const index = segment ? Number(segment.getAttribute("data-chart-index")) : null;
|
|
19134
|
+
if (index == null || index !== dismissedIndex.current) setActiveIndex(index);
|
|
19135
|
+
return;
|
|
19136
|
+
}
|
|
19137
|
+
const bounds = event.currentTarget.getBoundingClientRect();
|
|
19138
|
+
const position = exploration.axis === "y" ? (event.clientY - bounds.top) / bounds.height : (event.clientX - bounds.left) / bounds.width;
|
|
19139
|
+
const nearest = exploration.items.reduce((best, item, index, items) => Math.abs(item.position - position) < Math.abs(items[best].position - position) ? index : best, 0);
|
|
19140
|
+
if (nearest !== dismissedIndex.current) setActiveIndex(nearest);
|
|
19141
|
+
}
|
|
19046
19142
|
return /* @__PURE__ */ jsx91(
|
|
19047
19143
|
"div",
|
|
19048
19144
|
{
|
|
@@ -19056,7 +19152,92 @@ function ChartContainer({
|
|
|
19056
19152
|
className
|
|
19057
19153
|
),
|
|
19058
19154
|
children: empty ? /* @__PURE__ */ jsx91("p", { className: "pimolu-chart__empty", role: "status", children: emptyLabel }) : /* @__PURE__ */ jsxs67(Fragment13, { children: [
|
|
19059
|
-
/* @__PURE__ */
|
|
19155
|
+
/* @__PURE__ */ jsxs67(
|
|
19156
|
+
"div",
|
|
19157
|
+
{
|
|
19158
|
+
className: "pimolu-chart__canvas",
|
|
19159
|
+
tabIndex: exploration ? 0 : void 0,
|
|
19160
|
+
role: exploration ? "group" : void 0,
|
|
19161
|
+
"aria-label": exploration ? `${exploration.label}: explore values` : void 0,
|
|
19162
|
+
"aria-describedby": exploration ? instructionsId : void 0,
|
|
19163
|
+
onFocus: () => {
|
|
19164
|
+
if (exploration && !pointerFocus.current) {
|
|
19165
|
+
setKeyboard(true);
|
|
19166
|
+
setActiveIndex(0);
|
|
19167
|
+
}
|
|
19168
|
+
},
|
|
19169
|
+
onBlur: () => {
|
|
19170
|
+
pointerFocus.current = false;
|
|
19171
|
+
dismissedIndex.current = null;
|
|
19172
|
+
setActiveIndex(null);
|
|
19173
|
+
},
|
|
19174
|
+
onKeyDown: (event) => {
|
|
19175
|
+
if (!exploration?.items.length) return;
|
|
19176
|
+
const count = exploration.items.length;
|
|
19177
|
+
const previous = activeIndex ?? 0;
|
|
19178
|
+
let next;
|
|
19179
|
+
switch (event.key) {
|
|
19180
|
+
case "ArrowRight":
|
|
19181
|
+
case "ArrowDown":
|
|
19182
|
+
next = Math.min(previous + 1, count - 1);
|
|
19183
|
+
break;
|
|
19184
|
+
case "ArrowLeft":
|
|
19185
|
+
case "ArrowUp":
|
|
19186
|
+
next = Math.max(previous - 1, 0);
|
|
19187
|
+
break;
|
|
19188
|
+
case "Home":
|
|
19189
|
+
next = 0;
|
|
19190
|
+
break;
|
|
19191
|
+
case "End":
|
|
19192
|
+
next = count - 1;
|
|
19193
|
+
break;
|
|
19194
|
+
case "Escape":
|
|
19195
|
+
dismissedIndex.current = activeIndex;
|
|
19196
|
+
setActiveIndex(null);
|
|
19197
|
+
event.preventDefault();
|
|
19198
|
+
return;
|
|
19199
|
+
default:
|
|
19200
|
+
return;
|
|
19201
|
+
}
|
|
19202
|
+
event.preventDefault();
|
|
19203
|
+
dismissedIndex.current = null;
|
|
19204
|
+
setKeyboard(true);
|
|
19205
|
+
setActiveIndex(Math.max(0, Math.min(next, count - 1)));
|
|
19206
|
+
},
|
|
19207
|
+
onPointerMove: explorePointer,
|
|
19208
|
+
onPointerDown: (event) => {
|
|
19209
|
+
pointerFocus.current = true;
|
|
19210
|
+
dismissedIndex.current = null;
|
|
19211
|
+
explorePointer(event);
|
|
19212
|
+
},
|
|
19213
|
+
onPointerLeave: () => {
|
|
19214
|
+
dismissedIndex.current = null;
|
|
19215
|
+
if (!keyboard) setActiveIndex(null);
|
|
19216
|
+
},
|
|
19217
|
+
children: [
|
|
19218
|
+
children,
|
|
19219
|
+
exploration && /* @__PURE__ */ jsx91("span", { id: instructionsId, className: "pimolu-chart__sr-only", children: exploration.instructions ?? "Use arrow keys to explore values, Home and End to jump, Escape to dismiss." }),
|
|
19220
|
+
active && /* @__PURE__ */ jsxs67(Fragment13, { children: [
|
|
19221
|
+
exploration?.axis === "x" && /* @__PURE__ */ jsx91(
|
|
19222
|
+
"span",
|
|
19223
|
+
{
|
|
19224
|
+
className: "pimolu-chart__cursor",
|
|
19225
|
+
"aria-hidden": "true",
|
|
19226
|
+
style: { left: `${active.position * 100}%` }
|
|
19227
|
+
}
|
|
19228
|
+
),
|
|
19229
|
+
/* @__PURE__ */ jsxs67("div", { id: tooltipId, role: "tooltip", className: "pimolu-chart__tooltip", "aria-live": keyboard ? "polite" : "off", children: [
|
|
19230
|
+
/* @__PURE__ */ jsx91("strong", { children: active.label }),
|
|
19231
|
+
active.rows.map((row, index) => /* @__PURE__ */ jsxs67("div", { className: "pimolu-chart__tooltip-row", children: [
|
|
19232
|
+
/* @__PURE__ */ jsx91("span", { className: "pimolu-chart__legend-swatch", "aria-hidden": "true", style: { backgroundColor: row.color } }),
|
|
19233
|
+
/* @__PURE__ */ jsx91("span", { children: row.label }),
|
|
19234
|
+
/* @__PURE__ */ jsx91("b", { children: row.value })
|
|
19235
|
+
] }, index))
|
|
19236
|
+
] })
|
|
19237
|
+
] })
|
|
19238
|
+
]
|
|
19239
|
+
}
|
|
19240
|
+
),
|
|
19060
19241
|
table,
|
|
19061
19242
|
legend
|
|
19062
19243
|
] })
|
|
@@ -19075,6 +19256,7 @@ function ChartSvg({
|
|
|
19075
19256
|
{
|
|
19076
19257
|
className: "pimolu-chart__svg",
|
|
19077
19258
|
viewBox: `0 0 ${width} ${height}`,
|
|
19259
|
+
direction: "ltr",
|
|
19078
19260
|
role: "img",
|
|
19079
19261
|
"aria-label": label,
|
|
19080
19262
|
focusable: "false",
|
|
@@ -19132,7 +19314,7 @@ function ChartDataTable({
|
|
|
19132
19314
|
if (rows.length === 0) {
|
|
19133
19315
|
return null;
|
|
19134
19316
|
}
|
|
19135
|
-
return /* @__PURE__ */
|
|
19317
|
+
return /* @__PURE__ */ jsx91("div", { className: "pimolu-chart__sr-only", children: /* @__PURE__ */ jsxs67("table", { children: [
|
|
19136
19318
|
/* @__PURE__ */ jsxs67("caption", { children: [
|
|
19137
19319
|
label,
|
|
19138
19320
|
" data"
|
|
@@ -19142,7 +19324,7 @@ function ChartDataTable({
|
|
|
19142
19324
|
/* @__PURE__ */ jsx91("th", { scope: "row", children: row[0] }),
|
|
19143
19325
|
row.slice(1).map((cell, cellIndex) => /* @__PURE__ */ jsx91("td", { children: cell }, cellIndex))
|
|
19144
19326
|
] }, rowIndex)) })
|
|
19145
|
-
] });
|
|
19327
|
+
] }) });
|
|
19146
19328
|
}
|
|
19147
19329
|
var BarChart = forwardRef58(function BarChart2({
|
|
19148
19330
|
data = [],
|
|
@@ -19150,12 +19332,15 @@ var BarChart = forwardRef58(function BarChart2({
|
|
|
19150
19332
|
labels,
|
|
19151
19333
|
width = DEFAULT_WIDTH,
|
|
19152
19334
|
height = DEFAULT_HEIGHT,
|
|
19335
|
+
responsive = true,
|
|
19153
19336
|
max,
|
|
19154
19337
|
stacked = false,
|
|
19155
19338
|
horizontal = false,
|
|
19156
19339
|
showValues = false,
|
|
19157
19340
|
showGrid = true,
|
|
19158
19341
|
showLegend = false,
|
|
19342
|
+
showTooltip = true,
|
|
19343
|
+
interactionLabel,
|
|
19159
19344
|
valueFormatter,
|
|
19160
19345
|
emptyLabel = EMPTY_LABEL,
|
|
19161
19346
|
xAxisLabel,
|
|
@@ -19165,7 +19350,8 @@ var BarChart = forwardRef58(function BarChart2({
|
|
|
19165
19350
|
...props
|
|
19166
19351
|
}, ref) {
|
|
19167
19352
|
const formatter = valueFormatter ?? formatDefault;
|
|
19168
|
-
const
|
|
19353
|
+
const viewport = useCartesianViewport(width, ref, responsive);
|
|
19354
|
+
const viewWidth = viewport.width;
|
|
19169
19355
|
const viewHeight = safeSize(height, DEFAULT_HEIGHT);
|
|
19170
19356
|
const hasSeries = series.length > 0;
|
|
19171
19357
|
const maxSeriesLength = series.reduce(
|
|
@@ -19201,7 +19387,7 @@ var BarChart = forwardRef58(function BarChart2({
|
|
|
19201
19387
|
top: showValues ? 30 : 16,
|
|
19202
19388
|
right: 16,
|
|
19203
19389
|
bottom: 34 + (xAxisLabel ? 18 : 0),
|
|
19204
|
-
left:
|
|
19390
|
+
left: valueAxisWidth(ticks, formatter) + (yAxisLabel ? 16 : 0)
|
|
19205
19391
|
};
|
|
19206
19392
|
const plotLeft = margin.left;
|
|
19207
19393
|
const plotRight = Math.max(
|
|
@@ -19245,7 +19431,7 @@ var BarChart = forwardRef58(function BarChart2({
|
|
|
19245
19431
|
const horizontalBarHeight = horizontalUsable / seriesCount;
|
|
19246
19432
|
const visibleCategoryStep = Math.max(
|
|
19247
19433
|
1,
|
|
19248
|
-
Math.ceil(categoryCount /
|
|
19434
|
+
Math.ceil(categoryCount / Math.max(2, Math.floor((horizontal ? plotHeight : plotWidth) / (horizontal ? 28 : 48))))
|
|
19249
19435
|
);
|
|
19250
19436
|
categoryLabels.forEach((label, categoryIndex) => {
|
|
19251
19437
|
if (categoryIndex % visibleCategoryStep !== 0 && categoryIndex !== categoryCount - 1) {
|
|
@@ -19634,8 +19820,22 @@ var BarChart = forwardRef58(function BarChart2({
|
|
|
19634
19820
|
ChartContainer,
|
|
19635
19821
|
{
|
|
19636
19822
|
...props,
|
|
19637
|
-
containerRef:
|
|
19823
|
+
containerRef: viewport.containerRef,
|
|
19638
19824
|
kind: "bar",
|
|
19825
|
+
exploration: showTooltip ? {
|
|
19826
|
+
label: accessibleLabel,
|
|
19827
|
+
instructions: interactionLabel,
|
|
19828
|
+
axis: horizontal ? "y" : "x",
|
|
19829
|
+
items: categoryLabels.map((label, index) => ({
|
|
19830
|
+
label,
|
|
19831
|
+
position: horizontal ? (plotTop + horizontalBand * (index + 0.5)) / viewHeight : (plotLeft + verticalBand * (index + 0.5)) / viewWidth,
|
|
19832
|
+
rows: hasSeries ? series.map((item, seriesIndex) => ({
|
|
19833
|
+
label: item.name,
|
|
19834
|
+
color: resolveColor2(item.color, seriesIndex),
|
|
19835
|
+
value: Number.isFinite(item.values[index]) ? formatter(item.values[index]) : "\u2014"
|
|
19836
|
+
})) : [{ label, color: resolveColor2(data[index]?.color, index), value: formatter(data[index]?.value ?? 0) }]
|
|
19837
|
+
}))
|
|
19838
|
+
} : void 0,
|
|
19639
19839
|
className: classes22(
|
|
19640
19840
|
horizontal ? "pimolu-chart--horizontal" : void 0,
|
|
19641
19841
|
className
|
|
@@ -19769,6 +19969,15 @@ var BarChart = forwardRef58(function BarChart2({
|
|
|
19769
19969
|
);
|
|
19770
19970
|
});
|
|
19771
19971
|
BarChart.displayName = "PimoluBarChart";
|
|
19972
|
+
function trendPath(points, smooth) {
|
|
19973
|
+
return points.map((point, index) => {
|
|
19974
|
+
if (index === 0) return `M${round2(point.x)} ${round2(point.y)}`;
|
|
19975
|
+
const previous = points[index - 1];
|
|
19976
|
+
if (!smooth) return `L${round2(point.x)} ${round2(point.y)}`;
|
|
19977
|
+
const middle = round2((previous.x + point.x) / 2);
|
|
19978
|
+
return `C${middle} ${round2(previous.y)} ${middle} ${round2(point.y)} ${round2(point.x)} ${round2(point.y)}`;
|
|
19979
|
+
}).join(" ");
|
|
19980
|
+
}
|
|
19772
19981
|
function LinePlot({
|
|
19773
19982
|
area,
|
|
19774
19983
|
forwardedRef,
|
|
@@ -19776,10 +19985,15 @@ function LinePlot({
|
|
|
19776
19985
|
labels,
|
|
19777
19986
|
width = DEFAULT_WIDTH,
|
|
19778
19987
|
height = DEFAULT_HEIGHT,
|
|
19988
|
+
responsive = true,
|
|
19779
19989
|
max,
|
|
19780
19990
|
showGrid = true,
|
|
19781
19991
|
showPoints = false,
|
|
19782
19992
|
showLegend = true,
|
|
19993
|
+
showTooltip = true,
|
|
19994
|
+
interactionLabel,
|
|
19995
|
+
curve = "linear",
|
|
19996
|
+
areaFill = "gradient",
|
|
19783
19997
|
valueFormatter,
|
|
19784
19998
|
emptyLabel = EMPTY_LABEL,
|
|
19785
19999
|
xAxisLabel,
|
|
@@ -19788,8 +20002,10 @@ function LinePlot({
|
|
|
19788
20002
|
"aria-label": ariaLabel,
|
|
19789
20003
|
...props
|
|
19790
20004
|
}) {
|
|
20005
|
+
const gradientId = `pimolu-chart-${useId41().replace(/:/g, "")}`;
|
|
19791
20006
|
const formatter = valueFormatter ?? formatDefault;
|
|
19792
|
-
const
|
|
20007
|
+
const viewport = useCartesianViewport(width, forwardedRef, responsive);
|
|
20008
|
+
const viewWidth = viewport.width;
|
|
19793
20009
|
const viewHeight = safeSize(height, DEFAULT_HEIGHT);
|
|
19794
20010
|
const maxSeriesLength = series.reduce(
|
|
19795
20011
|
(longest, item) => Math.max(longest, item.values.length),
|
|
@@ -19803,24 +20019,6 @@ function LinePlot({
|
|
|
19803
20019
|
{ length: categoryCount },
|
|
19804
20020
|
(_, index) => categoryLabel(labels, index)
|
|
19805
20021
|
);
|
|
19806
|
-
const margin = {
|
|
19807
|
-
top: 16,
|
|
19808
|
-
right: 16,
|
|
19809
|
-
bottom: 34 + (xAxisLabel ? 18 : 0),
|
|
19810
|
-
left: 48 + (yAxisLabel ? 16 : 0)
|
|
19811
|
-
};
|
|
19812
|
-
const plotLeft = margin.left;
|
|
19813
|
-
const plotRight = Math.max(
|
|
19814
|
-
plotLeft,
|
|
19815
|
-
viewWidth - margin.right
|
|
19816
|
-
);
|
|
19817
|
-
const plotTop = margin.top;
|
|
19818
|
-
const plotBottom = Math.max(
|
|
19819
|
-
plotTop,
|
|
19820
|
-
viewHeight - margin.bottom
|
|
19821
|
-
);
|
|
19822
|
-
const plotWidth = plotRight - plotLeft;
|
|
19823
|
-
const plotHeight = plotBottom - plotTop;
|
|
19824
20022
|
const empty = series.length === 0 || categoryCount === 0 || series.every(
|
|
19825
20023
|
(item) => !item.values.some(
|
|
19826
20024
|
(value) => Number.isFinite(value)
|
|
@@ -19840,8 +20038,20 @@ function LinePlot({
|
|
|
19840
20038
|
domainMax - domainMin,
|
|
19841
20039
|
1
|
|
19842
20040
|
);
|
|
19843
|
-
const zeroY = plotBottom - (0 - domainMin) / domainSpan * plotHeight;
|
|
19844
20041
|
const ticks = buildTicks(domainMin, domainMax);
|
|
20042
|
+
const margin = {
|
|
20043
|
+
top: 16,
|
|
20044
|
+
right: 16,
|
|
20045
|
+
bottom: 34 + (xAxisLabel ? 18 : 0),
|
|
20046
|
+
left: valueAxisWidth(ticks, formatter) + (yAxisLabel ? 16 : 0)
|
|
20047
|
+
};
|
|
20048
|
+
const plotLeft = margin.left;
|
|
20049
|
+
const plotRight = Math.max(plotLeft, viewWidth - margin.right);
|
|
20050
|
+
const plotTop = margin.top;
|
|
20051
|
+
const plotBottom = Math.max(plotTop, viewHeight - margin.bottom);
|
|
20052
|
+
const plotWidth = plotRight - plotLeft;
|
|
20053
|
+
const plotHeight = plotBottom - plotTop;
|
|
20054
|
+
const zeroY = plotBottom - (0 - domainMin) / domainSpan * plotHeight;
|
|
19845
20055
|
const xForIndex = (index) => categoryCount === 1 ? plotLeft + plotWidth / 2 : plotLeft + index / Math.max(categoryCount - 1, 1) * plotWidth;
|
|
19846
20056
|
const yForValue = (value) => plotBottom - (value - domainMin) / domainSpan * plotHeight;
|
|
19847
20057
|
const plotted = series.map((item, seriesIndex) => {
|
|
@@ -19860,18 +20070,18 @@ function LinePlot({
|
|
|
19860
20070
|
];
|
|
19861
20071
|
}
|
|
19862
20072
|
);
|
|
19863
|
-
const
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
const
|
|
19870
|
-
const areaPath =
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
zeroY
|
|
19874
|
-
)
|
|
20073
|
+
const runs = [];
|
|
20074
|
+
points.forEach((point) => {
|
|
20075
|
+
const run = runs[runs.length - 1];
|
|
20076
|
+
if (!run || run[run.length - 1].index !== point.index - 1) runs.push([point]);
|
|
20077
|
+
else run.push(point);
|
|
20078
|
+
});
|
|
20079
|
+
const linePath = runs.map((run) => trendPath(run, curve === "smooth")).join(" ");
|
|
20080
|
+
const areaPath = runs.map((run) => {
|
|
20081
|
+
const first = run[0];
|
|
20082
|
+
const last = run[run.length - 1];
|
|
20083
|
+
return `${trendPath(run, curve === "smooth")} L${round2(last.x)} ${round2(zeroY)} L${round2(first.x)} ${round2(zeroY)} Z`;
|
|
20084
|
+
}).join(" ");
|
|
19875
20085
|
return {
|
|
19876
20086
|
item,
|
|
19877
20087
|
seriesIndex,
|
|
@@ -19883,7 +20093,7 @@ function LinePlot({
|
|
|
19883
20093
|
});
|
|
19884
20094
|
const visibleCategoryStep = Math.max(
|
|
19885
20095
|
1,
|
|
19886
|
-
Math.ceil(categoryCount /
|
|
20096
|
+
Math.ceil(categoryCount / Math.max(2, Math.floor(plotWidth / 64)))
|
|
19887
20097
|
);
|
|
19888
20098
|
const legendItems = series.map(
|
|
19889
20099
|
(item, index) => ({
|
|
@@ -19910,8 +20120,22 @@ function LinePlot({
|
|
|
19910
20120
|
ChartContainer,
|
|
19911
20121
|
{
|
|
19912
20122
|
...props,
|
|
19913
|
-
containerRef:
|
|
20123
|
+
containerRef: viewport.containerRef,
|
|
19914
20124
|
kind: area ? "area" : "line",
|
|
20125
|
+
exploration: showTooltip ? {
|
|
20126
|
+
label: accessibleLabel,
|
|
20127
|
+
instructions: interactionLabel,
|
|
20128
|
+
axis: "x",
|
|
20129
|
+
items: categoryLabels.map((label, index) => ({
|
|
20130
|
+
label,
|
|
20131
|
+
position: xForIndex(index) / viewWidth,
|
|
20132
|
+
rows: series.map((item, seriesIndex) => ({
|
|
20133
|
+
label: item.name,
|
|
20134
|
+
color: resolveColor2(item.color, seriesIndex),
|
|
20135
|
+
value: Number.isFinite(item.values[index]) ? formatter(item.values[index]) : "\u2014"
|
|
20136
|
+
}))
|
|
20137
|
+
}))
|
|
20138
|
+
} : void 0,
|
|
19915
20139
|
className,
|
|
19916
20140
|
empty,
|
|
19917
20141
|
emptyLabel,
|
|
@@ -19933,134 +20157,144 @@ function LinePlot({
|
|
|
19933
20157
|
rows: tableRows
|
|
19934
20158
|
}
|
|
19935
20159
|
),
|
|
19936
|
-
children: /* @__PURE__ */
|
|
20160
|
+
children: /* @__PURE__ */ jsxs67(
|
|
19937
20161
|
ChartSvg,
|
|
19938
20162
|
{
|
|
19939
20163
|
width: viewWidth,
|
|
19940
20164
|
height: viewHeight,
|
|
19941
20165
|
label: accessibleLabel,
|
|
19942
20166
|
description,
|
|
19943
|
-
children:
|
|
19944
|
-
|
|
19945
|
-
"
|
|
19946
|
-
{
|
|
19947
|
-
|
|
19948
|
-
|
|
19949
|
-
|
|
19950
|
-
|
|
19951
|
-
y2: yForValue(tick)
|
|
19952
|
-
},
|
|
19953
|
-
`grid-${index}`
|
|
19954
|
-
)),
|
|
19955
|
-
/* @__PURE__ */ jsx91(
|
|
19956
|
-
"line",
|
|
19957
|
-
{
|
|
19958
|
-
className: "pimolu-chart__axis",
|
|
19959
|
-
x1: plotLeft,
|
|
19960
|
-
x2: plotRight,
|
|
19961
|
-
y1: plotBottom,
|
|
19962
|
-
y2: plotBottom
|
|
19963
|
-
}
|
|
19964
|
-
),
|
|
19965
|
-
ticks.map((tick, index) => /* @__PURE__ */ jsx91(
|
|
19966
|
-
"text",
|
|
19967
|
-
{
|
|
19968
|
-
className: "pimolu-chart__axis-label",
|
|
19969
|
-
x: plotLeft - 8,
|
|
19970
|
-
y: yForValue(tick),
|
|
19971
|
-
textAnchor: "end",
|
|
19972
|
-
dominantBaseline: "middle",
|
|
19973
|
-
children: formatter(tick)
|
|
19974
|
-
},
|
|
19975
|
-
`tick-${index}`
|
|
19976
|
-
)),
|
|
19977
|
-
categoryLabels.map((label, index) => {
|
|
19978
|
-
if (index % visibleCategoryStep !== 0 && index !== categoryCount - 1) {
|
|
19979
|
-
return null;
|
|
19980
|
-
}
|
|
19981
|
-
return /* @__PURE__ */ jsx91(
|
|
19982
|
-
"text",
|
|
20167
|
+
children: [
|
|
20168
|
+
area && areaFill === "gradient" && /* @__PURE__ */ jsx91("defs", { children: plotted.map((entry) => /* @__PURE__ */ jsxs67("linearGradient", { id: `${gradientId}-${entry.seriesIndex}`, x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
20169
|
+
/* @__PURE__ */ jsx91("stop", { offset: "0%", stopColor: entry.color, stopOpacity: 0.28 }),
|
|
20170
|
+
/* @__PURE__ */ jsx91("stop", { offset: "100%", stopColor: entry.color, stopOpacity: 0.02 })
|
|
20171
|
+
] }, entry.seriesIndex)) }),
|
|
20172
|
+
/* @__PURE__ */ jsxs67("g", { "aria-hidden": "true", children: [
|
|
20173
|
+
showGrid && ticks.map((tick, index) => /* @__PURE__ */ jsx91(
|
|
20174
|
+
"line",
|
|
19983
20175
|
{
|
|
19984
|
-
className: "pimolu-
|
|
19985
|
-
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
20176
|
+
className: "pimolu-chart__grid",
|
|
20177
|
+
x1: plotLeft,
|
|
20178
|
+
x2: plotRight,
|
|
20179
|
+
y1: yForValue(tick),
|
|
20180
|
+
y2: yForValue(tick)
|
|
19989
20181
|
},
|
|
19990
|
-
`
|
|
19991
|
-
)
|
|
19992
|
-
|
|
19993
|
-
|
|
19994
|
-
(entry) => entry.areaPath !== "" ? /* @__PURE__ */ jsx91(
|
|
19995
|
-
"path",
|
|
20182
|
+
`grid-${index}`
|
|
20183
|
+
)),
|
|
20184
|
+
/* @__PURE__ */ jsx91(
|
|
20185
|
+
"line",
|
|
19996
20186
|
{
|
|
19997
|
-
className: "pimolu-
|
|
19998
|
-
|
|
19999
|
-
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
}
|
|
20003
|
-
|
|
20004
|
-
)
|
|
20005
|
-
|
|
20006
|
-
plotted.map(
|
|
20007
|
-
(entry) => entry.linePath !== "" ? /* @__PURE__ */ jsx91(
|
|
20008
|
-
"path",
|
|
20187
|
+
className: "pimolu-chart__axis",
|
|
20188
|
+
x1: plotLeft,
|
|
20189
|
+
x2: plotRight,
|
|
20190
|
+
y1: plotBottom,
|
|
20191
|
+
y2: plotBottom
|
|
20192
|
+
}
|
|
20193
|
+
),
|
|
20194
|
+
ticks.map((tick, index) => /* @__PURE__ */ jsx91(
|
|
20195
|
+
"text",
|
|
20009
20196
|
{
|
|
20010
|
-
className: "pimolu-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
"data-series": entry.item.name
|
|
20197
|
+
className: "pimolu-chart__axis-label",
|
|
20198
|
+
x: plotLeft - 8,
|
|
20199
|
+
y: yForValue(tick),
|
|
20200
|
+
textAnchor: "end",
|
|
20201
|
+
dominantBaseline: "middle",
|
|
20202
|
+
children: formatter(tick)
|
|
20017
20203
|
},
|
|
20018
|
-
`
|
|
20019
|
-
)
|
|
20020
|
-
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
return
|
|
20025
|
-
|
|
20026
|
-
|
|
20027
|
-
|
|
20204
|
+
`tick-${index}`
|
|
20205
|
+
)),
|
|
20206
|
+
categoryLabels.map((label, index) => {
|
|
20207
|
+
if (index % visibleCategoryStep !== 0 && index !== categoryCount - 1) {
|
|
20208
|
+
return null;
|
|
20209
|
+
}
|
|
20210
|
+
return /* @__PURE__ */ jsx91(
|
|
20211
|
+
"text",
|
|
20212
|
+
{
|
|
20213
|
+
className: "pimolu-chart__axis-label",
|
|
20214
|
+
x: xForIndex(index),
|
|
20215
|
+
y: plotBottom + 18,
|
|
20216
|
+
textAnchor: "middle",
|
|
20217
|
+
children: label
|
|
20218
|
+
},
|
|
20219
|
+
`category-${index}`
|
|
20220
|
+
);
|
|
20221
|
+
}),
|
|
20222
|
+
area && plotted.map(
|
|
20223
|
+
(entry) => entry.areaPath !== "" ? /* @__PURE__ */ jsx91(
|
|
20224
|
+
"path",
|
|
20225
|
+
{
|
|
20226
|
+
className: "pimolu-chart__area",
|
|
20227
|
+
d: entry.areaPath,
|
|
20228
|
+
fill: areaFill === "gradient" ? `url(#${gradientId}-${entry.seriesIndex})` : entry.color,
|
|
20229
|
+
style: {
|
|
20230
|
+
...styleForColor(entry.color),
|
|
20231
|
+
"--pimolu-chart-area-fill": areaFill === "gradient" ? `url(#${gradientId}-${entry.seriesIndex})` : entry.color,
|
|
20232
|
+
"--pimolu-chart-area-opacity": areaFill === "gradient" ? 1 : 0.16
|
|
20233
|
+
},
|
|
20234
|
+
"data-series": entry.item.name
|
|
20235
|
+
},
|
|
20236
|
+
`area-${entry.seriesIndex}`
|
|
20237
|
+
) : null
|
|
20238
|
+
),
|
|
20239
|
+
plotted.map(
|
|
20240
|
+
(entry) => entry.linePath !== "" ? /* @__PURE__ */ jsx91(
|
|
20241
|
+
"path",
|
|
20242
|
+
{
|
|
20243
|
+
className: "pimolu-chart__line",
|
|
20244
|
+
d: entry.linePath,
|
|
20245
|
+
pathLength: 1,
|
|
20246
|
+
fill: "none",
|
|
20247
|
+
stroke: entry.color,
|
|
20248
|
+
style: styleForColor(entry.color),
|
|
20249
|
+
"data-series": entry.item.name
|
|
20250
|
+
},
|
|
20251
|
+
`line-${entry.seriesIndex}`
|
|
20252
|
+
) : null
|
|
20253
|
+
),
|
|
20254
|
+
plotted.map((entry) => {
|
|
20255
|
+
const showSeriesPoints = showPoints || entry.points.length === 1;
|
|
20256
|
+
if (!showSeriesPoints) {
|
|
20257
|
+
return null;
|
|
20258
|
+
}
|
|
20259
|
+
return /* @__PURE__ */ jsx91("g", { children: entry.points.map((point) => /* @__PURE__ */ jsx91(
|
|
20260
|
+
"circle",
|
|
20261
|
+
{
|
|
20262
|
+
className: "pimolu-chart__point",
|
|
20263
|
+
cx: point.x,
|
|
20264
|
+
cy: point.y,
|
|
20265
|
+
r: 3.5,
|
|
20266
|
+
fill: entry.color,
|
|
20267
|
+
stroke: "var(--pimolu-chart-surface, var(--pimolu-surface, #ffffff))",
|
|
20268
|
+
style: styleForColor(entry.color),
|
|
20269
|
+
"data-series": entry.item.name,
|
|
20270
|
+
"data-value": point.value
|
|
20271
|
+
},
|
|
20272
|
+
`point-${entry.seriesIndex}-${point.index}`
|
|
20273
|
+
)) }, `points-${entry.seriesIndex}`);
|
|
20274
|
+
}),
|
|
20275
|
+
xAxisLabel != null && /* @__PURE__ */ jsx91(
|
|
20276
|
+
"text",
|
|
20028
20277
|
{
|
|
20029
|
-
className: "pimolu-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
children: xAxisLabel
|
|
20050
|
-
}
|
|
20051
|
-
),
|
|
20052
|
-
yAxisLabel != null && /* @__PURE__ */ jsx91(
|
|
20053
|
-
"text",
|
|
20054
|
-
{
|
|
20055
|
-
className: "pimolu-chart__axis-title",
|
|
20056
|
-
x: 14,
|
|
20057
|
-
y: (plotTop + plotBottom) / 2,
|
|
20058
|
-
textAnchor: "middle",
|
|
20059
|
-
transform: `rotate(-90 14 ${(plotTop + plotBottom) / 2})`,
|
|
20060
|
-
children: yAxisLabel
|
|
20061
|
-
}
|
|
20062
|
-
)
|
|
20063
|
-
] })
|
|
20278
|
+
className: "pimolu-chart__axis-title",
|
|
20279
|
+
x: (plotLeft + plotRight) / 2,
|
|
20280
|
+
y: viewHeight - 6,
|
|
20281
|
+
textAnchor: "middle",
|
|
20282
|
+
children: xAxisLabel
|
|
20283
|
+
}
|
|
20284
|
+
),
|
|
20285
|
+
yAxisLabel != null && /* @__PURE__ */ jsx91(
|
|
20286
|
+
"text",
|
|
20287
|
+
{
|
|
20288
|
+
className: "pimolu-chart__axis-title",
|
|
20289
|
+
x: 14,
|
|
20290
|
+
y: (plotTop + plotBottom) / 2,
|
|
20291
|
+
textAnchor: "middle",
|
|
20292
|
+
transform: `rotate(-90 14 ${(plotTop + plotBottom) / 2})`,
|
|
20293
|
+
children: yAxisLabel
|
|
20294
|
+
}
|
|
20295
|
+
)
|
|
20296
|
+
] })
|
|
20297
|
+
]
|
|
20064
20298
|
}
|
|
20065
20299
|
)
|
|
20066
20300
|
}
|
|
@@ -20096,6 +20330,8 @@ var DonutChart = forwardRef58(function DonutChart2({
|
|
|
20096
20330
|
centerValue,
|
|
20097
20331
|
centerLabel,
|
|
20098
20332
|
showLegend = true,
|
|
20333
|
+
showTooltip = true,
|
|
20334
|
+
interactionLabel,
|
|
20099
20335
|
valueFormatter,
|
|
20100
20336
|
emptyLabel = EMPTY_LABEL,
|
|
20101
20337
|
className,
|
|
@@ -20158,7 +20394,8 @@ var DonutChart = forwardRef58(function DonutChart2({
|
|
|
20158
20394
|
resolveColor2(datum.color, index)
|
|
20159
20395
|
),
|
|
20160
20396
|
"data-label": datum.label,
|
|
20161
|
-
"data-value": datum.value
|
|
20397
|
+
"data-value": datum.value,
|
|
20398
|
+
"data-chart-index": index
|
|
20162
20399
|
},
|
|
20163
20400
|
`segment-${index}`
|
|
20164
20401
|
)
|
|
@@ -20189,6 +20426,20 @@ var DonutChart = forwardRef58(function DonutChart2({
|
|
|
20189
20426
|
...props,
|
|
20190
20427
|
containerRef: ref,
|
|
20191
20428
|
kind: "donut",
|
|
20429
|
+
exploration: showTooltip ? {
|
|
20430
|
+
label: accessibleLabel,
|
|
20431
|
+
instructions: interactionLabel,
|
|
20432
|
+
axis: "segment",
|
|
20433
|
+
items: data.map((datum, index) => ({
|
|
20434
|
+
label: datum.label,
|
|
20435
|
+
position: index / Math.max(data.length, 1),
|
|
20436
|
+
rows: [{
|
|
20437
|
+
label: datum.label,
|
|
20438
|
+
color: resolveColor2(datum.color, index),
|
|
20439
|
+
value: `${formatter(values[index])} \xB7 ${total > 0 ? Math.round(values[index] / total * 100) : 0}%`
|
|
20440
|
+
}]
|
|
20441
|
+
}))
|
|
20442
|
+
} : void 0,
|
|
20192
20443
|
className,
|
|
20193
20444
|
empty,
|
|
20194
20445
|
emptyLabel,
|
|
@@ -20383,10 +20634,10 @@ Sparkline.displayName = "PimoluSparkline";
|
|
|
20383
20634
|
import {
|
|
20384
20635
|
createContext as createContext15,
|
|
20385
20636
|
useContext as useContext15,
|
|
20386
|
-
useEffect as
|
|
20387
|
-
useId as
|
|
20388
|
-
useRef as
|
|
20389
|
-
useState as
|
|
20637
|
+
useEffect as useEffect39,
|
|
20638
|
+
useId as useId42,
|
|
20639
|
+
useRef as useRef46,
|
|
20640
|
+
useState as useState52
|
|
20390
20641
|
} from "react";
|
|
20391
20642
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
20392
20643
|
function classNames(...values) {
|
|
@@ -20426,17 +20677,17 @@ function useForm({
|
|
|
20426
20677
|
validate,
|
|
20427
20678
|
onSubmit
|
|
20428
20679
|
}) {
|
|
20429
|
-
const formId =
|
|
20430
|
-
const [values, setValuesState] =
|
|
20680
|
+
const formId = useId42();
|
|
20681
|
+
const [values, setValuesState] = useState52(
|
|
20431
20682
|
() => ({ ...defaultValues })
|
|
20432
20683
|
);
|
|
20433
|
-
const [errors, setErrorsState] =
|
|
20684
|
+
const [errors, setErrorsState] = useState52(
|
|
20434
20685
|
{}
|
|
20435
20686
|
);
|
|
20436
|
-
const [isSubmitting, setIsSubmitting] =
|
|
20437
|
-
const initialValues =
|
|
20438
|
-
const mounted =
|
|
20439
|
-
|
|
20687
|
+
const [isSubmitting, setIsSubmitting] = useState52(false);
|
|
20688
|
+
const initialValues = useRef46({ ...defaultValues });
|
|
20689
|
+
const mounted = useRef46(true);
|
|
20690
|
+
useEffect39(() => {
|
|
20440
20691
|
mounted.current = true;
|
|
20441
20692
|
return () => {
|
|
20442
20693
|
mounted.current = false;
|
|
@@ -20634,10 +20885,10 @@ function FormSubmit({
|
|
|
20634
20885
|
import {
|
|
20635
20886
|
forwardRef as forwardRef59,
|
|
20636
20887
|
useCallback as useCallback22,
|
|
20637
|
-
useId as
|
|
20888
|
+
useId as useId43,
|
|
20638
20889
|
useLayoutEffect as useLayoutEffect3,
|
|
20639
|
-
useRef as
|
|
20640
|
-
useState as
|
|
20890
|
+
useRef as useRef47,
|
|
20891
|
+
useState as useState53
|
|
20641
20892
|
} from "react";
|
|
20642
20893
|
import { jsx as jsx93, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
20643
20894
|
function tokenPattern(char) {
|
|
@@ -20763,9 +21014,9 @@ var MaskedInput = forwardRef59(function MaskedInput2({
|
|
|
20763
21014
|
"aria-invalid": ariaInvalid,
|
|
20764
21015
|
...props
|
|
20765
21016
|
}, forwardedRef) {
|
|
20766
|
-
const generatedId =
|
|
21017
|
+
const generatedId = useId43();
|
|
20767
21018
|
const inputId = id ?? `pimolu-masked-input-${generatedId}`;
|
|
20768
|
-
const inputRef =
|
|
21019
|
+
const inputRef = useRef47(null);
|
|
20769
21020
|
const tokens = parseMask(mask);
|
|
20770
21021
|
const format = useCallback22(
|
|
20771
21022
|
(raw) => formatSlots(collectSlots(raw, tokens), tokens),
|
|
@@ -20774,11 +21025,11 @@ var MaskedInput = forwardRef59(function MaskedInput2({
|
|
|
20774
21025
|
[mask]
|
|
20775
21026
|
);
|
|
20776
21027
|
const isControlled = value !== void 0;
|
|
20777
|
-
const [localValue, setLocalValue] =
|
|
21028
|
+
const [localValue, setLocalValue] = useState53(
|
|
20778
21029
|
() => format(String(defaultValue ?? ""))
|
|
20779
21030
|
);
|
|
20780
21031
|
const displayValue = isControlled ? format(String(value ?? "")) : localValue;
|
|
20781
|
-
const pendingCaret =
|
|
21032
|
+
const pendingCaret = useRef47(null);
|
|
20782
21033
|
useFormReset(inputRef, !isControlled, () => {
|
|
20783
21034
|
setLocalValue(format(String(defaultValue ?? "")));
|
|
20784
21035
|
});
|
|
@@ -20902,11 +21153,11 @@ MaskedInput.displayName = "PimoluMaskedInput";
|
|
|
20902
21153
|
import {
|
|
20903
21154
|
forwardRef as forwardRef60,
|
|
20904
21155
|
useCallback as useCallback23,
|
|
20905
|
-
useEffect as
|
|
20906
|
-
useId as
|
|
21156
|
+
useEffect as useEffect40,
|
|
21157
|
+
useId as useId44,
|
|
20907
21158
|
useMemo as useMemo15,
|
|
20908
|
-
useRef as
|
|
20909
|
-
useState as
|
|
21159
|
+
useRef as useRef48,
|
|
21160
|
+
useState as useState54
|
|
20910
21161
|
} from "react";
|
|
20911
21162
|
import { jsx as jsx94, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
20912
21163
|
var DEFAULT_LOCALE = "en-US";
|
|
@@ -21027,9 +21278,9 @@ var CurrencyInput = forwardRef60(function CurrencyInput2({
|
|
|
21027
21278
|
"aria-invalid": ariaInvalid,
|
|
21028
21279
|
...props
|
|
21029
21280
|
}, forwardedRef) {
|
|
21030
|
-
const generatedId =
|
|
21281
|
+
const generatedId = useId44();
|
|
21031
21282
|
const inputId = id ?? `pimolu-currency-input-${generatedId}`;
|
|
21032
|
-
const inputRef =
|
|
21283
|
+
const inputRef = useRef48(null);
|
|
21033
21284
|
const isControlled = value !== void 0;
|
|
21034
21285
|
const resolvedDecimals = resolveDecimals(
|
|
21035
21286
|
locale,
|
|
@@ -21058,17 +21309,17 @@ var CurrencyInput = forwardRef60(function CurrencyInput2({
|
|
|
21058
21309
|
if (next === null) return "";
|
|
21059
21310
|
return String(next).replace(".", decimalSeparator);
|
|
21060
21311
|
}
|
|
21061
|
-
const [internalValue, setInternalValue] =
|
|
21312
|
+
const [internalValue, setInternalValue] = useState54(() => finiteOrNull2(defaultValue));
|
|
21062
21313
|
const currentValue = isControlled ? finiteOrNull2(value) : internalValue;
|
|
21063
|
-
const [draft, setDraft] =
|
|
21314
|
+
const [draft, setDraft] = useState54(
|
|
21064
21315
|
() => formatCurrency(
|
|
21065
21316
|
finiteOrNull2(
|
|
21066
21317
|
isControlled ? value : defaultValue
|
|
21067
21318
|
)
|
|
21068
21319
|
)
|
|
21069
21320
|
);
|
|
21070
|
-
const [focused, setFocused] =
|
|
21071
|
-
|
|
21321
|
+
const [focused, setFocused] = useState54(false);
|
|
21322
|
+
useEffect40(() => {
|
|
21072
21323
|
if (focused) return;
|
|
21073
21324
|
setDraft(formatCurrency(currentValue));
|
|
21074
21325
|
}, [
|
|
@@ -21217,11 +21468,11 @@ CurrencyInput.displayName = "PimoluCurrencyInput";
|
|
|
21217
21468
|
import {
|
|
21218
21469
|
forwardRef as forwardRef61,
|
|
21219
21470
|
useCallback as useCallback24,
|
|
21220
|
-
useEffect as
|
|
21221
|
-
useId as
|
|
21471
|
+
useEffect as useEffect41,
|
|
21472
|
+
useId as useId45,
|
|
21222
21473
|
useLayoutEffect as useLayoutEffect4,
|
|
21223
|
-
useRef as
|
|
21224
|
-
useState as
|
|
21474
|
+
useRef as useRef49,
|
|
21475
|
+
useState as useState55
|
|
21225
21476
|
} from "react";
|
|
21226
21477
|
import { jsx as jsx95, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
21227
21478
|
var defaultPhoneCountries = [
|
|
@@ -21466,12 +21717,12 @@ var PhoneInput = forwardRef61(function PhoneInput2({
|
|
|
21466
21717
|
"aria-invalid": ariaInvalid,
|
|
21467
21718
|
...props
|
|
21468
21719
|
}, forwardedRef) {
|
|
21469
|
-
const generatedId =
|
|
21720
|
+
const generatedId = useId45();
|
|
21470
21721
|
const inputId = id ?? `pimolu-phone-input-${generatedId}`;
|
|
21471
|
-
const inputRef =
|
|
21722
|
+
const inputRef = useRef49(null);
|
|
21472
21723
|
const countryList = countries && countries.length > 0 ? countries : defaultPhoneCountries;
|
|
21473
21724
|
const isControlled = value !== void 0;
|
|
21474
|
-
const [internalValue, setInternalValue] =
|
|
21725
|
+
const [internalValue, setInternalValue] = useState55(
|
|
21475
21726
|
() => String(defaultValue ?? "")
|
|
21476
21727
|
);
|
|
21477
21728
|
const requestedCountry = country ?? defaultCountry;
|
|
@@ -21480,7 +21731,7 @@ var PhoneInput = forwardRef61(function PhoneInput2({
|
|
|
21480
21731
|
) ?? countryList.find(
|
|
21481
21732
|
(item) => item.code === defaultCountry
|
|
21482
21733
|
) ?? countryList[0] ?? FALLBACK_COUNTRY;
|
|
21483
|
-
const [internalCountry, setInternalCountry] =
|
|
21734
|
+
const [internalCountry, setInternalCountry] = useState55(
|
|
21484
21735
|
initialCountry.code
|
|
21485
21736
|
);
|
|
21486
21737
|
const selectedCountry = countryList.find(
|
|
@@ -21502,8 +21753,8 @@ var PhoneInput = forwardRef61(function PhoneInput2({
|
|
|
21502
21753
|
nationalDigits,
|
|
21503
21754
|
activeCountry.pattern
|
|
21504
21755
|
);
|
|
21505
|
-
const pendingCaret =
|
|
21506
|
-
|
|
21756
|
+
const pendingCaret = useRef49(null);
|
|
21757
|
+
useEffect41(() => {
|
|
21507
21758
|
if (country !== void 0 || !parsed.international) return;
|
|
21508
21759
|
if (parsed.country.code !== internalCountry) {
|
|
21509
21760
|
setInternalCountry(parsed.country.code);
|
|
@@ -21692,11 +21943,11 @@ PhoneInput.displayName = "PimoluPhoneInput";
|
|
|
21692
21943
|
import {
|
|
21693
21944
|
forwardRef as forwardRef62,
|
|
21694
21945
|
useCallback as useCallback25,
|
|
21695
|
-
useEffect as
|
|
21696
|
-
useId as
|
|
21946
|
+
useEffect as useEffect42,
|
|
21947
|
+
useId as useId46,
|
|
21697
21948
|
useMemo as useMemo16,
|
|
21698
|
-
useRef as
|
|
21699
|
-
useState as
|
|
21949
|
+
useRef as useRef50,
|
|
21950
|
+
useState as useState56
|
|
21700
21951
|
} from "react";
|
|
21701
21952
|
import { jsx as jsx96, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
21702
21953
|
function getMentionContext(text, caret, trigger) {
|
|
@@ -21742,13 +21993,13 @@ var Mentions = forwardRef62(function Mentions2({
|
|
|
21742
21993
|
"aria-labelledby": ariaLabelledBy,
|
|
21743
21994
|
"aria-describedby": ariaDescribedBy
|
|
21744
21995
|
}, forwardedRef) {
|
|
21745
|
-
const generatedId =
|
|
21996
|
+
const generatedId = useId46();
|
|
21746
21997
|
const inputId = id ?? `pimolu-mentions-${generatedId}`;
|
|
21747
21998
|
const listboxId = `${inputId}-listbox`;
|
|
21748
21999
|
const helperId = `${inputId}-helper`;
|
|
21749
|
-
const rootRef =
|
|
21750
|
-
const textareaRef =
|
|
21751
|
-
const listboxRef =
|
|
22000
|
+
const rootRef = useRef50(null);
|
|
22001
|
+
const textareaRef = useRef50(null);
|
|
22002
|
+
const listboxRef = useRef50(null);
|
|
21752
22003
|
const assignRef = useCallback25(
|
|
21753
22004
|
(node) => {
|
|
21754
22005
|
textareaRef.current = node;
|
|
@@ -21761,13 +22012,13 @@ var Mentions = forwardRef62(function Mentions2({
|
|
|
21761
22012
|
[forwardedRef]
|
|
21762
22013
|
);
|
|
21763
22014
|
const isControlled = value !== void 0;
|
|
21764
|
-
const [internalValue, setInternalValue] =
|
|
22015
|
+
const [internalValue, setInternalValue] = useState56(defaultValue);
|
|
21765
22016
|
const text = isControlled ? String(value ?? "") : internalValue;
|
|
21766
|
-
const [isOpen, setIsOpen] =
|
|
21767
|
-
const [context, setContext] =
|
|
21768
|
-
const [activeIndex, setActiveIndex] =
|
|
21769
|
-
const [dismissed, setDismissed] =
|
|
21770
|
-
const [caretRequest, setCaretRequest] =
|
|
22017
|
+
const [isOpen, setIsOpen] = useState56(false);
|
|
22018
|
+
const [context, setContext] = useState56(null);
|
|
22019
|
+
const [activeIndex, setActiveIndex] = useState56(0);
|
|
22020
|
+
const [dismissed, setDismissed] = useState56(false);
|
|
22021
|
+
const [caretRequest, setCaretRequest] = useState56(null);
|
|
21771
22022
|
const filteredOptions = useMemo16(() => {
|
|
21772
22023
|
if (!context) return [];
|
|
21773
22024
|
const query = normalizeSearch(context.query);
|
|
@@ -21943,13 +22194,13 @@ var Mentions = forwardRef62(function Mentions2({
|
|
|
21943
22194
|
setIsOpen(false);
|
|
21944
22195
|
setActiveIndex(0);
|
|
21945
22196
|
});
|
|
21946
|
-
|
|
22197
|
+
useEffect42(() => {
|
|
21947
22198
|
if (!suggestionsOpen) return;
|
|
21948
22199
|
listboxRef.current?.querySelector(
|
|
21949
22200
|
'[data-active="true"]'
|
|
21950
22201
|
)?.scrollIntoView?.({ block: "nearest" });
|
|
21951
22202
|
}, [suggestionsOpen, safeActiveIndex]);
|
|
21952
|
-
|
|
22203
|
+
useEffect42(() => {
|
|
21953
22204
|
if (!caretRequest) return;
|
|
21954
22205
|
const element = textareaRef.current;
|
|
21955
22206
|
if (element) {
|
|
@@ -22132,10 +22383,10 @@ Mentions.displayName = "PimoluMentions";
|
|
|
22132
22383
|
import {
|
|
22133
22384
|
forwardRef as forwardRef63,
|
|
22134
22385
|
useCallback as useCallback26,
|
|
22135
|
-
useEffect as
|
|
22136
|
-
useId as
|
|
22137
|
-
useRef as
|
|
22138
|
-
useState as
|
|
22386
|
+
useEffect as useEffect43,
|
|
22387
|
+
useId as useId47,
|
|
22388
|
+
useRef as useRef51,
|
|
22389
|
+
useState as useState57
|
|
22139
22390
|
} from "react";
|
|
22140
22391
|
import { jsx as jsx97, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
22141
22392
|
function pathKey(path) {
|
|
@@ -22222,15 +22473,15 @@ var Cascader = forwardRef63(function Cascader2({
|
|
|
22222
22473
|
"aria-labelledby": ariaLabelledBy,
|
|
22223
22474
|
"aria-describedby": ariaDescribedBy
|
|
22224
22475
|
}, forwardedRef) {
|
|
22225
|
-
const generatedId =
|
|
22476
|
+
const generatedId = useId47();
|
|
22226
22477
|
const triggerId = id ?? `pimolu-cascader-${generatedId}`;
|
|
22227
22478
|
const labelId = `${triggerId}-label`;
|
|
22228
22479
|
const listboxId = `${triggerId}-listbox`;
|
|
22229
22480
|
const messageId = helperText ? `${triggerId}-message` : void 0;
|
|
22230
|
-
const rootRef =
|
|
22231
|
-
const fieldRef =
|
|
22232
|
-
const triggerRef =
|
|
22233
|
-
const listboxRef =
|
|
22481
|
+
const rootRef = useRef51(null);
|
|
22482
|
+
const fieldRef = useRef51(null);
|
|
22483
|
+
const triggerRef = useRef51(null);
|
|
22484
|
+
const listboxRef = useRef51(null);
|
|
22234
22485
|
const assignRef = useCallback26(
|
|
22235
22486
|
(node) => {
|
|
22236
22487
|
triggerRef.current = node;
|
|
@@ -22243,11 +22494,11 @@ var Cascader = forwardRef63(function Cascader2({
|
|
|
22243
22494
|
[forwardedRef]
|
|
22244
22495
|
);
|
|
22245
22496
|
const isControlled = value !== void 0;
|
|
22246
|
-
const [internalValue, setInternalValue] =
|
|
22497
|
+
const [internalValue, setInternalValue] = useState57(() => [...defaultValue]);
|
|
22247
22498
|
const selectedPath = isControlled ? value : internalValue;
|
|
22248
|
-
const [isOpen, setIsOpen] =
|
|
22249
|
-
const [expandedPath, setExpandedPath] =
|
|
22250
|
-
const [activePath, setActivePath] =
|
|
22499
|
+
const [isOpen, setIsOpen] = useState57(false);
|
|
22500
|
+
const [expandedPath, setExpandedPath] = useState57([]);
|
|
22501
|
+
const [activePath, setActivePath] = useState57(null);
|
|
22251
22502
|
const columns = getColumns(options, expandedPath);
|
|
22252
22503
|
const flatOptions = flattenColumns(columns);
|
|
22253
22504
|
const selectedLabels = labelsForPath(
|
|
@@ -22413,7 +22664,7 @@ var Cascader = forwardRef63(function Cascader2({
|
|
|
22413
22664
|
target: [rootRef, listboxRef],
|
|
22414
22665
|
onDismiss: closeMenu
|
|
22415
22666
|
});
|
|
22416
|
-
|
|
22667
|
+
useEffect43(() => {
|
|
22417
22668
|
if (!isOpen || activeIndex < 0) return;
|
|
22418
22669
|
listboxRef.current?.querySelector(
|
|
22419
22670
|
'[data-active="true"]'
|
|
@@ -22671,9 +22922,9 @@ Cascader.displayName = "PimoluCascader";
|
|
|
22671
22922
|
|
|
22672
22923
|
// transfer/transfer.tsx
|
|
22673
22924
|
import {
|
|
22674
|
-
useId as
|
|
22925
|
+
useId as useId48,
|
|
22675
22926
|
useMemo as useMemo17,
|
|
22676
|
-
useState as
|
|
22927
|
+
useState as useState58
|
|
22677
22928
|
} from "react";
|
|
22678
22929
|
import { Fragment as Fragment14, jsx as jsx98, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
22679
22930
|
var DEFAULT_LIST_HEIGHT = 240;
|
|
@@ -22703,13 +22954,13 @@ function Transfer({
|
|
|
22703
22954
|
style,
|
|
22704
22955
|
"aria-label": ariaLabel
|
|
22705
22956
|
}) {
|
|
22706
|
-
const generatedId =
|
|
22957
|
+
const generatedId = useId48();
|
|
22707
22958
|
const sourceTitle = titles?.[0] ?? "Source";
|
|
22708
22959
|
const targetTitle = titles?.[1] ?? "Target";
|
|
22709
22960
|
const sourceTitleId = `${generatedId}-source-title`;
|
|
22710
22961
|
const targetTitleId = `${generatedId}-target-title`;
|
|
22711
22962
|
const isControlled = targetKeys !== void 0;
|
|
22712
|
-
const [internalTargets, setInternalTargets] =
|
|
22963
|
+
const [internalTargets, setInternalTargets] = useState58(() => [...defaultTargetKeys]);
|
|
22713
22964
|
const targets = isControlled ? targetKeys : internalTargets;
|
|
22714
22965
|
const targetSet = useMemo17(
|
|
22715
22966
|
() => new Set(targets),
|
|
@@ -22733,9 +22984,9 @@ function Transfer({
|
|
|
22733
22984
|
),
|
|
22734
22985
|
[targets, itemsByKey]
|
|
22735
22986
|
);
|
|
22736
|
-
const [checkedKeys, setCheckedKeys] =
|
|
22737
|
-
const [leftQuery, setLeftQuery] =
|
|
22738
|
-
const [rightQuery, setRightQuery] =
|
|
22987
|
+
const [checkedKeys, setCheckedKeys] = useState58([]);
|
|
22988
|
+
const [leftQuery, setLeftQuery] = useState58("");
|
|
22989
|
+
const [rightQuery, setRightQuery] = useState58("");
|
|
22739
22990
|
const checkedSet = new Set(checkedKeys);
|
|
22740
22991
|
const visibleSource = filterItems(
|
|
22741
22992
|
sourceItems,
|
|
@@ -23034,9 +23285,9 @@ Transfer.displayName = "PimoluTransfer";
|
|
|
23034
23285
|
import {
|
|
23035
23286
|
forwardRef as forwardRef64,
|
|
23036
23287
|
useCallback as useCallback27,
|
|
23037
|
-
useEffect as
|
|
23038
|
-
useRef as
|
|
23039
|
-
useState as
|
|
23288
|
+
useEffect as useEffect44,
|
|
23289
|
+
useRef as useRef52,
|
|
23290
|
+
useState as useState59
|
|
23040
23291
|
} from "react";
|
|
23041
23292
|
import { Fragment as Fragment15, jsx as jsx99, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
23042
23293
|
function classes23(...values) {
|
|
@@ -23151,26 +23402,26 @@ var VideoPlayer = forwardRef64(function VideoPlayer2({
|
|
|
23151
23402
|
"aria-label": ariaLabel,
|
|
23152
23403
|
...props
|
|
23153
23404
|
}, forwardedRef) {
|
|
23154
|
-
const mediaRef =
|
|
23405
|
+
const mediaRef = useRef52(
|
|
23155
23406
|
null
|
|
23156
23407
|
);
|
|
23157
|
-
const rootRef =
|
|
23408
|
+
const rootRef = useRef52(null);
|
|
23158
23409
|
const controlled = controlledPlaying !== void 0;
|
|
23159
|
-
const [internalPlaying, setInternalPlaying] =
|
|
23410
|
+
const [internalPlaying, setInternalPlaying] = useState59(false);
|
|
23160
23411
|
const isPlaying = controlled ? controlledPlaying : internalPlaying;
|
|
23161
|
-
const [currentTime, setCurrentTime] =
|
|
23162
|
-
const [duration, setDuration] =
|
|
23163
|
-
const [volume, setVolume] =
|
|
23412
|
+
const [currentTime, setCurrentTime] = useState59(0);
|
|
23413
|
+
const [duration, setDuration] = useState59(0);
|
|
23414
|
+
const [volume, setVolume] = useState59(
|
|
23164
23415
|
() => clamp7(
|
|
23165
23416
|
Number.isFinite(defaultVolume) ? defaultVolume : 1,
|
|
23166
23417
|
0,
|
|
23167
23418
|
1
|
|
23168
23419
|
)
|
|
23169
23420
|
);
|
|
23170
|
-
const [muted, setMuted] =
|
|
23171
|
-
const [canFullscreen, setCanFullscreen] =
|
|
23172
|
-
const [fullscreen, setFullscreen] =
|
|
23173
|
-
const announcedPlaying =
|
|
23421
|
+
const [muted, setMuted] = useState59(initialMuted);
|
|
23422
|
+
const [canFullscreen, setCanFullscreen] = useState59(false);
|
|
23423
|
+
const [fullscreen, setFullscreen] = useState59(false);
|
|
23424
|
+
const announcedPlaying = useRef52(
|
|
23174
23425
|
controlledPlaying ?? false
|
|
23175
23426
|
);
|
|
23176
23427
|
const commitPlaying = useCallback27(
|
|
@@ -23197,13 +23448,13 @@ var VideoPlayer = forwardRef64(function VideoPlayer2({
|
|
|
23197
23448
|
},
|
|
23198
23449
|
[forwardedRef]
|
|
23199
23450
|
);
|
|
23200
|
-
|
|
23451
|
+
useEffect44(() => {
|
|
23201
23452
|
const media = mediaRef.current;
|
|
23202
23453
|
if (!media) return;
|
|
23203
23454
|
media.volume = volume;
|
|
23204
23455
|
media.muted = muted;
|
|
23205
23456
|
}, []);
|
|
23206
|
-
|
|
23457
|
+
useEffect44(() => {
|
|
23207
23458
|
const media = mediaRef.current;
|
|
23208
23459
|
if (!media) return;
|
|
23209
23460
|
const currentMedia = media;
|
|
@@ -23218,7 +23469,7 @@ var VideoPlayer = forwardRef64(function VideoPlayer2({
|
|
|
23218
23469
|
media.removeEventListener("durationchange", syncDuration);
|
|
23219
23470
|
};
|
|
23220
23471
|
}, [src]);
|
|
23221
|
-
|
|
23472
|
+
useEffect44(() => {
|
|
23222
23473
|
if (!controlled) return;
|
|
23223
23474
|
announcedPlaying.current = controlledPlaying;
|
|
23224
23475
|
const media = mediaRef.current;
|
|
@@ -23229,7 +23480,7 @@ var VideoPlayer = forwardRef64(function VideoPlayer2({
|
|
|
23229
23480
|
media.pause();
|
|
23230
23481
|
}
|
|
23231
23482
|
}, [controlled, controlledPlaying]);
|
|
23232
|
-
|
|
23483
|
+
useEffect44(() => {
|
|
23233
23484
|
if (typeof document === "undefined") {
|
|
23234
23485
|
return;
|
|
23235
23486
|
}
|
|
@@ -23546,9 +23797,9 @@ VideoPlayer.displayName = "PimoluVideoPlayer";
|
|
|
23546
23797
|
import {
|
|
23547
23798
|
forwardRef as forwardRef65,
|
|
23548
23799
|
useCallback as useCallback28,
|
|
23549
|
-
useEffect as
|
|
23550
|
-
useRef as
|
|
23551
|
-
useState as
|
|
23800
|
+
useEffect as useEffect45,
|
|
23801
|
+
useRef as useRef53,
|
|
23802
|
+
useState as useState60
|
|
23552
23803
|
} from "react";
|
|
23553
23804
|
import { Fragment as Fragment16, jsx as jsx100, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
23554
23805
|
function classes24(...values) {
|
|
@@ -23645,23 +23896,23 @@ var AudioPlayer = forwardRef65(function AudioPlayer2({
|
|
|
23645
23896
|
"aria-label": ariaLabel,
|
|
23646
23897
|
...props
|
|
23647
23898
|
}, forwardedRef) {
|
|
23648
|
-
const mediaRef =
|
|
23899
|
+
const mediaRef = useRef53(
|
|
23649
23900
|
null
|
|
23650
23901
|
);
|
|
23651
23902
|
const controlled = controlledPlaying !== void 0;
|
|
23652
|
-
const [internalPlaying, setInternalPlaying] =
|
|
23903
|
+
const [internalPlaying, setInternalPlaying] = useState60(false);
|
|
23653
23904
|
const isPlaying = controlled ? controlledPlaying : internalPlaying;
|
|
23654
|
-
const [currentTime, setCurrentTime] =
|
|
23655
|
-
const [duration, setDuration] =
|
|
23656
|
-
const [volume, setVolume] =
|
|
23905
|
+
const [currentTime, setCurrentTime] = useState60(0);
|
|
23906
|
+
const [duration, setDuration] = useState60(0);
|
|
23907
|
+
const [volume, setVolume] = useState60(
|
|
23657
23908
|
() => clamp8(
|
|
23658
23909
|
Number.isFinite(defaultVolume) ? defaultVolume : 1,
|
|
23659
23910
|
0,
|
|
23660
23911
|
1
|
|
23661
23912
|
)
|
|
23662
23913
|
);
|
|
23663
|
-
const [muted, setMuted] =
|
|
23664
|
-
const announcedPlaying =
|
|
23914
|
+
const [muted, setMuted] = useState60(initialMuted);
|
|
23915
|
+
const announcedPlaying = useRef53(
|
|
23665
23916
|
controlledPlaying ?? false
|
|
23666
23917
|
);
|
|
23667
23918
|
const commitPlaying = useCallback28(
|
|
@@ -23687,13 +23938,13 @@ var AudioPlayer = forwardRef65(function AudioPlayer2({
|
|
|
23687
23938
|
},
|
|
23688
23939
|
[forwardedRef]
|
|
23689
23940
|
);
|
|
23690
|
-
|
|
23941
|
+
useEffect45(() => {
|
|
23691
23942
|
const media = mediaRef.current;
|
|
23692
23943
|
if (!media) return;
|
|
23693
23944
|
media.volume = volume;
|
|
23694
23945
|
media.muted = muted;
|
|
23695
23946
|
}, []);
|
|
23696
|
-
|
|
23947
|
+
useEffect45(() => {
|
|
23697
23948
|
const media = mediaRef.current;
|
|
23698
23949
|
if (!media) return;
|
|
23699
23950
|
const currentMedia = media;
|
|
@@ -23708,7 +23959,7 @@ var AudioPlayer = forwardRef65(function AudioPlayer2({
|
|
|
23708
23959
|
media.removeEventListener("durationchange", syncDuration);
|
|
23709
23960
|
};
|
|
23710
23961
|
}, [src]);
|
|
23711
|
-
|
|
23962
|
+
useEffect45(() => {
|
|
23712
23963
|
if (!controlled) return;
|
|
23713
23964
|
announcedPlaying.current = controlledPlaying;
|
|
23714
23965
|
const media = mediaRef.current;
|
|
@@ -23967,7 +24218,7 @@ AudioPlayer.displayName = "PimoluAudioPlayer";
|
|
|
23967
24218
|
|
|
23968
24219
|
// pdf-viewer/pdf-viewer.tsx
|
|
23969
24220
|
import {
|
|
23970
|
-
useRef as
|
|
24221
|
+
useRef as useRef54
|
|
23971
24222
|
} from "react";
|
|
23972
24223
|
import { jsx as jsx101, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
23973
24224
|
function classes25(...values) {
|
|
@@ -23996,7 +24247,7 @@ function PDFViewer({
|
|
|
23996
24247
|
onLoad,
|
|
23997
24248
|
"aria-label": ariaLabel
|
|
23998
24249
|
}) {
|
|
23999
|
-
const toolbarRef =
|
|
24250
|
+
const toolbarRef = useRef54(
|
|
24000
24251
|
null
|
|
24001
24252
|
);
|
|
24002
24253
|
const resolvedLabels = {
|
|
@@ -24126,10 +24377,10 @@ PDFViewer.displayName = "PimoluPDFViewer";
|
|
|
24126
24377
|
// lightbox/lightbox.tsx
|
|
24127
24378
|
import {
|
|
24128
24379
|
useCallback as useCallback29,
|
|
24129
|
-
useEffect as
|
|
24130
|
-
useId as
|
|
24131
|
-
useRef as
|
|
24132
|
-
useState as
|
|
24380
|
+
useEffect as useEffect46,
|
|
24381
|
+
useId as useId49,
|
|
24382
|
+
useRef as useRef55,
|
|
24383
|
+
useState as useState61
|
|
24133
24384
|
} from "react";
|
|
24134
24385
|
import { Fragment as Fragment17, jsx as jsx102, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
24135
24386
|
function classes26(...values) {
|
|
@@ -24202,9 +24453,9 @@ function Lightbox({
|
|
|
24202
24453
|
}) {
|
|
24203
24454
|
const count = images.length;
|
|
24204
24455
|
const controlled = controlledOpen !== void 0;
|
|
24205
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
24456
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState61(defaultOpen);
|
|
24206
24457
|
const isOpen = controlled ? controlledOpen : uncontrolledOpen;
|
|
24207
|
-
const [internalIndex, setInternalIndex] =
|
|
24458
|
+
const [internalIndex, setInternalIndex] = useState61(
|
|
24208
24459
|
() => clampIndex2(initialIndex, count)
|
|
24209
24460
|
);
|
|
24210
24461
|
const currentIndex = clampIndex2(
|
|
@@ -24212,19 +24463,19 @@ function Lightbox({
|
|
|
24212
24463
|
count
|
|
24213
24464
|
);
|
|
24214
24465
|
const active = isOpen && count > 0;
|
|
24215
|
-
const anchorRef =
|
|
24466
|
+
const anchorRef = useRef55(
|
|
24216
24467
|
null
|
|
24217
24468
|
);
|
|
24218
|
-
const panelRef =
|
|
24469
|
+
const panelRef = useRef55(
|
|
24219
24470
|
null
|
|
24220
24471
|
);
|
|
24221
|
-
const closeRef =
|
|
24472
|
+
const closeRef = useRef55(
|
|
24222
24473
|
null
|
|
24223
24474
|
);
|
|
24224
|
-
const previousFocus =
|
|
24475
|
+
const previousFocus = useRef55(
|
|
24225
24476
|
null
|
|
24226
24477
|
);
|
|
24227
|
-
const captionId = `pimolu-lightbox-caption-${
|
|
24478
|
+
const captionId = `pimolu-lightbox-caption-${useId49()}`;
|
|
24228
24479
|
const setPanelRef = useCallback29(
|
|
24229
24480
|
(node) => {
|
|
24230
24481
|
panelRef.current = node;
|
|
@@ -24241,7 +24492,7 @@ function Lightbox({
|
|
|
24241
24492
|
[]
|
|
24242
24493
|
);
|
|
24243
24494
|
useBodyScrollLock(active);
|
|
24244
|
-
|
|
24495
|
+
useEffect46(() => {
|
|
24245
24496
|
if (!active) return;
|
|
24246
24497
|
previousFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
24247
24498
|
return () => {
|
|
@@ -24494,10 +24745,10 @@ Lightbox.displayName = "PimoluLightbox";
|
|
|
24494
24745
|
// image-cropper/image-cropper.tsx
|
|
24495
24746
|
import {
|
|
24496
24747
|
useCallback as useCallback30,
|
|
24497
|
-
useEffect as
|
|
24498
|
-
useId as
|
|
24499
|
-
useRef as
|
|
24500
|
-
useState as
|
|
24748
|
+
useEffect as useEffect47,
|
|
24749
|
+
useId as useId50,
|
|
24750
|
+
useRef as useRef56,
|
|
24751
|
+
useState as useState62
|
|
24501
24752
|
} from "react";
|
|
24502
24753
|
import { jsx as jsx103, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
24503
24754
|
var HANDLES = [
|
|
@@ -24753,15 +25004,15 @@ function ImageCropper({
|
|
|
24753
25004
|
labels,
|
|
24754
25005
|
className
|
|
24755
25006
|
}) {
|
|
24756
|
-
const instructionsId = `pimolu-image-cropper-instructions-${
|
|
25007
|
+
const instructionsId = `pimolu-image-cropper-instructions-${useId50()}`;
|
|
24757
25008
|
const ratio = aspectRatio !== void 0 && Number.isFinite(aspectRatio) && aspectRatio > 0 ? aspectRatio : void 0;
|
|
24758
25009
|
const sourceKey = cropFromSource(src);
|
|
24759
|
-
const [objectUrl, setObjectUrl] =
|
|
24760
|
-
const [intrinsic, setIntrinsic] =
|
|
25010
|
+
const [objectUrl, setObjectUrl] = useState62(null);
|
|
25011
|
+
const [intrinsic, setIntrinsic] = useState62(null);
|
|
24761
25012
|
const sourceAspect = intrinsic?.key === sourceKey ? intrinsic.aspect : null;
|
|
24762
25013
|
const stageAspect = ratio ?? sourceAspect ?? 1;
|
|
24763
25014
|
const resolvedSrc = typeof src === "string" ? src : objectUrl;
|
|
24764
|
-
const [internalCrop, setInternalCrop] =
|
|
25015
|
+
const [internalCrop, setInternalCrop] = useState62(
|
|
24765
25016
|
() => initialCrop ? normalizeCrop(
|
|
24766
25017
|
initialCrop,
|
|
24767
25018
|
defaultCrop(
|
|
@@ -24791,16 +25042,16 @@ function ImageCropper({
|
|
|
24791
25042
|
safeMinZoom,
|
|
24792
25043
|
safeMaxZoom
|
|
24793
25044
|
);
|
|
24794
|
-
const [zoom, setZoom] =
|
|
24795
|
-
const [dragging, setDragging] =
|
|
24796
|
-
const stageRef =
|
|
25045
|
+
const [zoom, setZoom] = useState62(safeDefaultZoom);
|
|
25046
|
+
const [dragging, setDragging] = useState62(false);
|
|
25047
|
+
const stageRef = useRef56(
|
|
24797
25048
|
null
|
|
24798
25049
|
);
|
|
24799
|
-
const imageRef =
|
|
25050
|
+
const imageRef = useRef56(
|
|
24800
25051
|
null
|
|
24801
25052
|
);
|
|
24802
|
-
const dragRef =
|
|
24803
|
-
|
|
25053
|
+
const dragRef = useRef56(null);
|
|
25054
|
+
useEffect47(() => {
|
|
24804
25055
|
setIntrinsic(null);
|
|
24805
25056
|
if (typeof src === "string") {
|
|
24806
25057
|
setObjectUrl(null);
|
|
@@ -24829,7 +25080,7 @@ function ImageCropper({
|
|
|
24829
25080
|
},
|
|
24830
25081
|
[controlledCrop, fallbackCrop, onChange]
|
|
24831
25082
|
);
|
|
24832
|
-
|
|
25083
|
+
useEffect47(() => {
|
|
24833
25084
|
if (controlledCrop !== void 0) return;
|
|
24834
25085
|
setInternalCrop(
|
|
24835
25086
|
initialCrop ? normalizeCrop(
|
|
@@ -24866,7 +25117,7 @@ function ImageCropper({
|
|
|
24866
25117
|
};
|
|
24867
25118
|
setDragging(true);
|
|
24868
25119
|
}
|
|
24869
|
-
|
|
25120
|
+
useEffect47(() => {
|
|
24870
25121
|
if (!dragging) return;
|
|
24871
25122
|
function handlePointerMove(event) {
|
|
24872
25123
|
const drag = dragRef.current;
|
|
@@ -26100,10 +26351,10 @@ AppShell.displayName = "PimoluAppShell";
|
|
|
26100
26351
|
import {
|
|
26101
26352
|
createContext as createContext16,
|
|
26102
26353
|
useContext as useContext16,
|
|
26103
|
-
useEffect as
|
|
26104
|
-
useId as
|
|
26105
|
-
useRef as
|
|
26106
|
-
useState as
|
|
26354
|
+
useEffect as useEffect48,
|
|
26355
|
+
useId as useId51,
|
|
26356
|
+
useRef as useRef57,
|
|
26357
|
+
useState as useState63
|
|
26107
26358
|
} from "react";
|
|
26108
26359
|
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
26109
26360
|
var MenubarContext = createContext16(null);
|
|
@@ -26136,10 +26387,10 @@ function Menubar({
|
|
|
26136
26387
|
className,
|
|
26137
26388
|
...props
|
|
26138
26389
|
}) {
|
|
26139
|
-
const [openValue, setOpenValue] =
|
|
26390
|
+
const [openValue, setOpenValue] = useState63(
|
|
26140
26391
|
null
|
|
26141
26392
|
);
|
|
26142
|
-
const menubarRef =
|
|
26393
|
+
const menubarRef = useRef57(null);
|
|
26143
26394
|
function getTriggers() {
|
|
26144
26395
|
return Array.from(
|
|
26145
26396
|
menubarRef.current?.querySelectorAll(
|
|
@@ -26152,7 +26403,7 @@ function Menubar({
|
|
|
26152
26403
|
trigger.tabIndex = trigger === active ? 0 : -1;
|
|
26153
26404
|
});
|
|
26154
26405
|
}
|
|
26155
|
-
|
|
26406
|
+
useEffect48(() => {
|
|
26156
26407
|
const triggers = getTriggers();
|
|
26157
26408
|
if (triggers.length === 0) return;
|
|
26158
26409
|
const focused = triggers.find(
|
|
@@ -26206,7 +26457,7 @@ function Menubar({
|
|
|
26206
26457
|
setOpenValue(value);
|
|
26207
26458
|
}
|
|
26208
26459
|
}
|
|
26209
|
-
|
|
26460
|
+
useEffect48(() => {
|
|
26210
26461
|
if (openValue === null) return;
|
|
26211
26462
|
function handleEscape(event) {
|
|
26212
26463
|
if (event.key !== "Escape") return;
|
|
@@ -26258,11 +26509,11 @@ function MenubarMenu({
|
|
|
26258
26509
|
className,
|
|
26259
26510
|
value: valueProp
|
|
26260
26511
|
}) {
|
|
26261
|
-
const generated =
|
|
26512
|
+
const generated = useId51();
|
|
26262
26513
|
const value = valueProp ?? `menu-${generated}`;
|
|
26263
26514
|
const triggerId = `pimolu-menubar-trigger-${generated}`;
|
|
26264
26515
|
const contentId = `pimolu-menubar-content-${generated}`;
|
|
26265
|
-
const triggerRef =
|
|
26516
|
+
const triggerRef = useRef57(
|
|
26266
26517
|
null
|
|
26267
26518
|
);
|
|
26268
26519
|
return /* @__PURE__ */ jsx106(
|
|
@@ -26346,7 +26597,7 @@ function MenubarSurface({
|
|
|
26346
26597
|
maxHeight: 420
|
|
26347
26598
|
}
|
|
26348
26599
|
);
|
|
26349
|
-
|
|
26600
|
+
useEffect48(() => {
|
|
26350
26601
|
const panel = contentRef.current;
|
|
26351
26602
|
if (!panel) return;
|
|
26352
26603
|
const first = panel.querySelector(
|
|
@@ -26412,7 +26663,7 @@ function MenubarContent({
|
|
|
26412
26663
|
const menubar = useMenubar("MenubarContent");
|
|
26413
26664
|
const menu = useMenubarMenu("MenubarContent");
|
|
26414
26665
|
const open = menubar.openValue === menu.value;
|
|
26415
|
-
const contentRef =
|
|
26666
|
+
const contentRef = useRef57(null);
|
|
26416
26667
|
useOutsidePointer(
|
|
26417
26668
|
[menu.triggerRef, contentRef],
|
|
26418
26669
|
open,
|
|
@@ -26505,9 +26756,9 @@ MenubarLabel.displayName = "PimoluMenubarLabel";
|
|
|
26505
26756
|
import {
|
|
26506
26757
|
createContext as createContext17,
|
|
26507
26758
|
useContext as useContext17,
|
|
26508
|
-
useEffect as
|
|
26509
|
-
useRef as
|
|
26510
|
-
useState as
|
|
26759
|
+
useEffect as useEffect49,
|
|
26760
|
+
useRef as useRef58,
|
|
26761
|
+
useState as useState64
|
|
26511
26762
|
} from "react";
|
|
26512
26763
|
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
26513
26764
|
var ToolbarContext = createContext17(null);
|
|
@@ -26549,8 +26800,8 @@ function Toolbar({
|
|
|
26549
26800
|
className,
|
|
26550
26801
|
...props
|
|
26551
26802
|
}) {
|
|
26552
|
-
const rootRef =
|
|
26553
|
-
|
|
26803
|
+
const rootRef = useRef58(null);
|
|
26804
|
+
useEffect49(() => {
|
|
26554
26805
|
const items = getEnabledItems2(rootRef.current);
|
|
26555
26806
|
if (items.length === 0) return;
|
|
26556
26807
|
const focused = items.find(
|
|
@@ -26728,10 +26979,10 @@ function ToolbarToggleGroup(props) {
|
|
|
26728
26979
|
} = props;
|
|
26729
26980
|
const multiple = props.type === "multiple";
|
|
26730
26981
|
const controlledValue = props.value;
|
|
26731
|
-
const [singleValue, setSingleValue] =
|
|
26982
|
+
const [singleValue, setSingleValue] = useState64(
|
|
26732
26983
|
multiple ? "" : props.defaultValue ?? ""
|
|
26733
26984
|
);
|
|
26734
|
-
const [multipleValue, setMultipleValue] =
|
|
26985
|
+
const [multipleValue, setMultipleValue] = useState64(
|
|
26735
26986
|
multiple ? props.defaultValue ?? [] : []
|
|
26736
26987
|
);
|
|
26737
26988
|
const value = controlledValue !== void 0 ? controlledValue : multiple ? multipleValue : singleValue;
|
|
@@ -26821,9 +27072,9 @@ ToolbarToggleItem.displayName = "PimoluToolbarToggleItem";
|
|
|
26821
27072
|
import {
|
|
26822
27073
|
cloneElement as cloneElement10,
|
|
26823
27074
|
isValidElement as isValidElement13,
|
|
26824
|
-
useId as
|
|
26825
|
-
useRef as
|
|
26826
|
-
useState as
|
|
27075
|
+
useId as useId52,
|
|
27076
|
+
useRef as useRef59,
|
|
27077
|
+
useState as useState65
|
|
26827
27078
|
} from "react";
|
|
26828
27079
|
import { jsx as jsx108, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
26829
27080
|
function assignNode(ref, node) {
|
|
@@ -26876,11 +27127,11 @@ function Popconfirm({
|
|
|
26876
27127
|
className
|
|
26877
27128
|
}) {
|
|
26878
27129
|
const isControlled = controlledOpen !== void 0;
|
|
26879
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
27130
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState65(defaultOpen);
|
|
26880
27131
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
26881
|
-
const triggerRef =
|
|
26882
|
-
const resolved =
|
|
26883
|
-
const titleId = `pimolu-popconfirm-title-${
|
|
27132
|
+
const triggerRef = useRef59(null);
|
|
27133
|
+
const resolved = useRef59(false);
|
|
27134
|
+
const titleId = `pimolu-popconfirm-title-${useId52()}`;
|
|
26884
27135
|
function requestOpen(next) {
|
|
26885
27136
|
if (next) {
|
|
26886
27137
|
resolved.current = false;
|
|
@@ -26988,11 +27239,11 @@ Popconfirm.displayName = "PimoluPopconfirm";
|
|
|
26988
27239
|
// tour/tour.tsx
|
|
26989
27240
|
import {
|
|
26990
27241
|
useCallback as useCallback31,
|
|
26991
|
-
useEffect as
|
|
26992
|
-
useId as
|
|
27242
|
+
useEffect as useEffect50,
|
|
27243
|
+
useId as useId53,
|
|
26993
27244
|
useLayoutEffect as useLayoutEffect5,
|
|
26994
|
-
useRef as
|
|
26995
|
-
useState as
|
|
27245
|
+
useRef as useRef60,
|
|
27246
|
+
useState as useState66
|
|
26996
27247
|
} from "react";
|
|
26997
27248
|
import { Fragment as Fragment18, jsx as jsx109, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
26998
27249
|
var CARD_WIDTH = 352;
|
|
@@ -27000,7 +27251,7 @@ var CARD_HEIGHT = 190;
|
|
|
27000
27251
|
var GAP = 12;
|
|
27001
27252
|
var VIEWPORT_MARGIN = 12;
|
|
27002
27253
|
var SPOTLIGHT_PADDING = 8;
|
|
27003
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect5 :
|
|
27254
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect5 : useEffect50;
|
|
27004
27255
|
function clamp11(value, min, max) {
|
|
27005
27256
|
return Math.min(Math.max(value, min), max);
|
|
27006
27257
|
}
|
|
@@ -27150,19 +27401,19 @@ function Tour({
|
|
|
27150
27401
|
className
|
|
27151
27402
|
}) {
|
|
27152
27403
|
const isControlled = controlledOpen !== void 0;
|
|
27153
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
27404
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState66(defaultOpen);
|
|
27154
27405
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
27155
|
-
const [mounted, setMounted] =
|
|
27156
|
-
|
|
27157
|
-
const [stepIndex, setStepIndex] =
|
|
27406
|
+
const [mounted, setMounted] = useState66(false);
|
|
27407
|
+
useEffect50(() => setMounted(true), []);
|
|
27408
|
+
const [stepIndex, setStepIndex] = useState66(
|
|
27158
27409
|
() => clampStep(initialStep, steps.length)
|
|
27159
27410
|
);
|
|
27160
27411
|
const index = clampStep(stepIndex, steps.length);
|
|
27161
27412
|
const currentStep = steps[index];
|
|
27162
27413
|
const targetSpec = currentStep?.target;
|
|
27163
|
-
const [target, setTarget] =
|
|
27164
|
-
const cardRef =
|
|
27165
|
-
const [cardMounted, setCardMounted] =
|
|
27414
|
+
const [target, setTarget] = useState66(null);
|
|
27415
|
+
const cardRef = useRef60(null);
|
|
27416
|
+
const [cardMounted, setCardMounted] = useState66(false);
|
|
27166
27417
|
const setCardRef = useCallback31(
|
|
27167
27418
|
(node) => {
|
|
27168
27419
|
cardRef.current = node;
|
|
@@ -27170,10 +27421,10 @@ function Tour({
|
|
|
27170
27421
|
},
|
|
27171
27422
|
[]
|
|
27172
27423
|
);
|
|
27173
|
-
const scopeRef =
|
|
27174
|
-
const titleId = `pimolu-tour-title-${
|
|
27175
|
-
const descriptionId = `pimolu-tour-description-${
|
|
27176
|
-
const [geometry, setGeometry] =
|
|
27424
|
+
const scopeRef = useRef60(null);
|
|
27425
|
+
const titleId = `pimolu-tour-title-${useId53()}`;
|
|
27426
|
+
const descriptionId = `pimolu-tour-description-${useId53()}`;
|
|
27427
|
+
const [geometry, setGeometry] = useState66(
|
|
27177
27428
|
() => centeredGeometry(
|
|
27178
27429
|
1024,
|
|
27179
27430
|
768,
|
|
@@ -27181,20 +27432,20 @@ function Tour({
|
|
|
27181
27432
|
CARD_HEIGHT
|
|
27182
27433
|
)
|
|
27183
27434
|
);
|
|
27184
|
-
const wasOpen =
|
|
27435
|
+
const wasOpen = useRef60(isOpen);
|
|
27185
27436
|
function requestOpen(next2) {
|
|
27186
27437
|
if (!isControlled) {
|
|
27187
27438
|
setUncontrolledOpen(next2);
|
|
27188
27439
|
}
|
|
27189
27440
|
onOpenChange?.(next2);
|
|
27190
27441
|
}
|
|
27191
|
-
|
|
27442
|
+
useEffect50(() => {
|
|
27192
27443
|
if (isOpen && !wasOpen.current) {
|
|
27193
27444
|
setStepIndex(clampStep(initialStep, steps.length));
|
|
27194
27445
|
}
|
|
27195
27446
|
wasOpen.current = isOpen;
|
|
27196
27447
|
}, [isOpen, initialStep, steps.length]);
|
|
27197
|
-
|
|
27448
|
+
useEffect50(() => {
|
|
27198
27449
|
if (!isOpen || !targetSpec) {
|
|
27199
27450
|
setTarget(null);
|
|
27200
27451
|
return;
|
|
@@ -27289,8 +27540,8 @@ function Tour({
|
|
|
27289
27540
|
containerRef: cardRef,
|
|
27290
27541
|
initialFocus: "container"
|
|
27291
27542
|
});
|
|
27292
|
-
const previousIndex =
|
|
27293
|
-
|
|
27543
|
+
const previousIndex = useRef60(index);
|
|
27544
|
+
useEffect50(() => {
|
|
27294
27545
|
if (!isOpen) {
|
|
27295
27546
|
previousIndex.current = index;
|
|
27296
27547
|
return;
|
|
@@ -27462,8 +27713,8 @@ Tour.displayName = "PimoluTour";
|
|
|
27462
27713
|
|
|
27463
27714
|
// notification-center/notification-center.tsx
|
|
27464
27715
|
import {
|
|
27465
|
-
useId as
|
|
27466
|
-
useState as
|
|
27716
|
+
useId as useId54,
|
|
27717
|
+
useState as useState67
|
|
27467
27718
|
} from "react";
|
|
27468
27719
|
import { Fragment as Fragment19, jsx as jsx110, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
27469
27720
|
function BellIcon() {
|
|
@@ -27528,10 +27779,10 @@ function NotificationCenter({
|
|
|
27528
27779
|
className
|
|
27529
27780
|
}) {
|
|
27530
27781
|
const isControlled = controlledOpen !== void 0;
|
|
27531
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
27782
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState67(defaultOpen);
|
|
27532
27783
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
27533
|
-
const [tab, setTab] =
|
|
27534
|
-
const baseId =
|
|
27784
|
+
const [tab, setTab] = useState67(defaultTab);
|
|
27785
|
+
const baseId = useId54();
|
|
27535
27786
|
const panelId = `pimolu-notification-center-${baseId}-panel`;
|
|
27536
27787
|
const unreadCount = notifications.filter(
|
|
27537
27788
|
(notification) => !notification.read
|
|
@@ -27761,10 +28012,10 @@ NotificationCenter.displayName = "PimoluNotificationCenter";
|
|
|
27761
28012
|
// kanban/kanban.tsx
|
|
27762
28013
|
import {
|
|
27763
28014
|
Fragment as Fragment20,
|
|
27764
|
-
useEffect as
|
|
27765
|
-
useId as
|
|
27766
|
-
useRef as
|
|
27767
|
-
useState as
|
|
28015
|
+
useEffect as useEffect51,
|
|
28016
|
+
useId as useId55,
|
|
28017
|
+
useRef as useRef61,
|
|
28018
|
+
useState as useState68
|
|
27768
28019
|
} from "react";
|
|
27769
28020
|
import { jsx as jsx111, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
27770
28021
|
var defaultLabels = {
|
|
@@ -27948,12 +28199,12 @@ function KanbanCardView({
|
|
|
27948
28199
|
onDragOverCard,
|
|
27949
28200
|
onCardKeyDown
|
|
27950
28201
|
}) {
|
|
27951
|
-
const [menuOpen, setMenuOpen] =
|
|
27952
|
-
const moveRootRef =
|
|
27953
|
-
const moveTriggerRef =
|
|
27954
|
-
const menuRef =
|
|
27955
|
-
const focusFirstItemRef =
|
|
27956
|
-
|
|
28202
|
+
const [menuOpen, setMenuOpen] = useState68(false);
|
|
28203
|
+
const moveRootRef = useRef61(null);
|
|
28204
|
+
const moveTriggerRef = useRef61(null);
|
|
28205
|
+
const menuRef = useRef61(null);
|
|
28206
|
+
const focusFirstItemRef = useRef61(false);
|
|
28207
|
+
useEffect51(() => {
|
|
27957
28208
|
if (!menuOpen) {
|
|
27958
28209
|
return;
|
|
27959
28210
|
}
|
|
@@ -27967,7 +28218,7 @@ function KanbanCardView({
|
|
|
27967
28218
|
document.removeEventListener("mousedown", handlePointerDown);
|
|
27968
28219
|
};
|
|
27969
28220
|
}, [menuOpen]);
|
|
27970
|
-
|
|
28221
|
+
useEffect51(() => {
|
|
27971
28222
|
if (!menuOpen || !focusFirstItemRef.current) {
|
|
27972
28223
|
return;
|
|
27973
28224
|
}
|
|
@@ -28226,16 +28477,16 @@ function Kanban({
|
|
|
28226
28477
|
...labelOverrides
|
|
28227
28478
|
};
|
|
28228
28479
|
const isControlled = controlledColumns !== void 0;
|
|
28229
|
-
const [internalColumns, setInternalColumns] =
|
|
28480
|
+
const [internalColumns, setInternalColumns] = useState68(() => cloneColumns(defaultColumns ?? []));
|
|
28230
28481
|
const boardColumns = controlledColumns ?? internalColumns;
|
|
28231
|
-
const baseId = `pimolu-kanban-${
|
|
28482
|
+
const baseId = `pimolu-kanban-${useId55()}`;
|
|
28232
28483
|
const instructionsId = `${baseId}-instructions`;
|
|
28233
|
-
const rootRef =
|
|
28234
|
-
const [dragState, setDragState] =
|
|
28235
|
-
const [dropTarget, setDropTarget] =
|
|
28236
|
-
const [announcement, setAnnouncement] =
|
|
28237
|
-
const [pendingFocus, setPendingFocus] =
|
|
28238
|
-
|
|
28484
|
+
const rootRef = useRef61(null);
|
|
28485
|
+
const [dragState, setDragState] = useState68(null);
|
|
28486
|
+
const [dropTarget, setDropTarget] = useState68(null);
|
|
28487
|
+
const [announcement, setAnnouncement] = useState68("");
|
|
28488
|
+
const [pendingFocus, setPendingFocus] = useState68(null);
|
|
28489
|
+
useEffect51(() => {
|
|
28239
28490
|
if (!pendingFocus) {
|
|
28240
28491
|
return;
|
|
28241
28492
|
}
|
|
@@ -28471,7 +28722,8 @@ function Kanban({
|
|
|
28471
28722
|
"aria-hidden": "true",
|
|
28472
28723
|
children: labels.full
|
|
28473
28724
|
}
|
|
28474
|
-
)
|
|
28725
|
+
),
|
|
28726
|
+
column.limit != null && column.limit > 0 && /* @__PURE__ */ jsx111("span", { className: "pimolu-kanban__capacity", "aria-hidden": "true", children: /* @__PURE__ */ jsx111("span", { style: { width: `${Math.min(100, column.cards.length / column.limit * 100)}%` } }) })
|
|
28475
28727
|
] }),
|
|
28476
28728
|
/* @__PURE__ */ jsxs84(
|
|
28477
28729
|
"ol",
|
|
@@ -28576,10 +28828,10 @@ function Kanban({
|
|
|
28576
28828
|
|
|
28577
28829
|
// chat/chat.tsx
|
|
28578
28830
|
import {
|
|
28579
|
-
useEffect as
|
|
28580
|
-
useId as
|
|
28581
|
-
useRef as
|
|
28582
|
-
useState as
|
|
28831
|
+
useEffect as useEffect52,
|
|
28832
|
+
useId as useId56,
|
|
28833
|
+
useRef as useRef62,
|
|
28834
|
+
useState as useState69
|
|
28583
28835
|
} from "react";
|
|
28584
28836
|
import { Fragment as Fragment21, jsx as jsx112, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
28585
28837
|
var defaultLabels2 = {
|
|
@@ -28875,11 +29127,11 @@ function Chat({
|
|
|
28875
29127
|
...defaultLabels2,
|
|
28876
29128
|
...labelOverrides
|
|
28877
29129
|
};
|
|
28878
|
-
const [draft, setDraft] =
|
|
28879
|
-
const listRef =
|
|
28880
|
-
const inputId = `pimolu-chat-${
|
|
29130
|
+
const [draft, setDraft] = useState69("");
|
|
29131
|
+
const listRef = useRef62(null);
|
|
29132
|
+
const inputId = `pimolu-chat-${useId56()}`;
|
|
28881
29133
|
const lastMessageId = messages.length > 0 ? messages[messages.length - 1]?.id : void 0;
|
|
28882
|
-
|
|
29134
|
+
useEffect52(() => {
|
|
28883
29135
|
const list = listRef.current;
|
|
28884
29136
|
if (!list) {
|
|
28885
29137
|
return;
|
|
@@ -29080,11 +29332,11 @@ function Chat({
|
|
|
29080
29332
|
|
|
29081
29333
|
// scheduler/scheduler.tsx
|
|
29082
29334
|
import {
|
|
29083
|
-
useEffect as
|
|
29335
|
+
useEffect as useEffect53,
|
|
29084
29336
|
useMemo as useMemo19,
|
|
29085
|
-
useRef as
|
|
29086
|
-
useId as
|
|
29087
|
-
useState as
|
|
29337
|
+
useRef as useRef63,
|
|
29338
|
+
useId as useId57,
|
|
29339
|
+
useState as useState70
|
|
29088
29340
|
} from "react";
|
|
29089
29341
|
import { jsx as jsx113, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
29090
29342
|
function startOfDay3(date) {
|
|
@@ -29196,16 +29448,17 @@ function Scheduler({
|
|
|
29196
29448
|
locale = "en-US",
|
|
29197
29449
|
showCurrentTime = true,
|
|
29198
29450
|
hourHeight = 64,
|
|
29451
|
+
maxHeight,
|
|
29199
29452
|
onEventClick,
|
|
29200
29453
|
onSlotClick,
|
|
29201
29454
|
className,
|
|
29202
29455
|
"aria-label": ariaLabel = "Schedule"
|
|
29203
29456
|
}) {
|
|
29204
29457
|
const dateControlled = date !== void 0;
|
|
29205
|
-
const [internalDate, setInternalDate] =
|
|
29458
|
+
const [internalDate, setInternalDate] = useState70(
|
|
29206
29459
|
() => startOfDay3(date ?? defaultDate ?? /* @__PURE__ */ new Date())
|
|
29207
29460
|
);
|
|
29208
|
-
const [internalView, setInternalView] =
|
|
29461
|
+
const [internalView, setInternalView] = useState70(defaultView);
|
|
29209
29462
|
const resolvedView = view ?? internalView;
|
|
29210
29463
|
const visibleDate = startOfDay3(date ?? internalDate);
|
|
29211
29464
|
const minHour = Math.max(
|
|
@@ -29238,10 +29491,10 @@ function Scheduler({
|
|
|
29238
29491
|
),
|
|
29239
29492
|
[hourCount, minHour]
|
|
29240
29493
|
);
|
|
29241
|
-
const gridRef =
|
|
29242
|
-
const keyboardHintId = `scheduler-keys-${
|
|
29243
|
-
const [activeCell, setActiveCell] =
|
|
29244
|
-
const [editingCell, setEditingCell] =
|
|
29494
|
+
const gridRef = useRef63(null);
|
|
29495
|
+
const keyboardHintId = `scheduler-keys-${useId57()}`;
|
|
29496
|
+
const [activeCell, setActiveCell] = useState70({ row: 1, column: 0 });
|
|
29497
|
+
const [editingCell, setEditingCell] = useState70(null);
|
|
29245
29498
|
const focusedRow = Math.min(activeCell.row, hours.length);
|
|
29246
29499
|
const focusedColumn = Math.min(activeCell.column, days.length - 1);
|
|
29247
29500
|
function handleGridKeyDown(event) {
|
|
@@ -29438,8 +29691,8 @@ function Scheduler({
|
|
|
29438
29691
|
const hasVisibleEvents = dayLayouts.some(
|
|
29439
29692
|
(layout) => layout.allDay.length > 0 || layout.timed.length > 0
|
|
29440
29693
|
);
|
|
29441
|
-
const [now, setNow] =
|
|
29442
|
-
|
|
29694
|
+
const [now, setNow] = useState70(() => /* @__PURE__ */ new Date());
|
|
29695
|
+
useEffect53(() => {
|
|
29443
29696
|
if (!showCurrentTime) return;
|
|
29444
29697
|
const timer = window.setInterval(() => {
|
|
29445
29698
|
setNow(/* @__PURE__ */ new Date());
|
|
@@ -29559,7 +29812,7 @@ function Scheduler({
|
|
|
29559
29812
|
}
|
|
29560
29813
|
),
|
|
29561
29814
|
/* @__PURE__ */ jsx113("p", { id: keyboardHintId, className: "pimolu-scheduler__sr-only", children: "Use arrow keys to navigate dates and times, Home and End to reach row boundaries, Control Home and Control End for the whole grid. Enter activates a slot. F2 explores actions inside a cell; Escape returns to the cell." }),
|
|
29562
|
-
/* @__PURE__ */ jsx113("div", { className: "pimolu-scheduler__scroll", children: /* @__PURE__ */ jsxs86(
|
|
29815
|
+
/* @__PURE__ */ jsx113("div", { className: "pimolu-scheduler__scroll", style: { maxHeight }, children: /* @__PURE__ */ jsxs86(
|
|
29563
29816
|
"div",
|
|
29564
29817
|
{
|
|
29565
29818
|
className: "pimolu-scheduler__board",
|
|
@@ -29771,11 +30024,12 @@ function Scheduler({
|
|
|
29771
30024
|
className: "pimolu-scheduler__event",
|
|
29772
30025
|
"data-lane": segment.lane,
|
|
29773
30026
|
"data-lanes": segment.lanes,
|
|
30027
|
+
"data-compact": (segment.end - segment.start) / 60 * hourHeight < 44 || void 0,
|
|
29774
30028
|
onClick: () => onEventClick?.(
|
|
29775
30029
|
segment.event.source
|
|
29776
30030
|
),
|
|
29777
30031
|
"aria-label": `${segment.event.source.title}, ${fullDateFormatter.format(layout.day)}, ${timeFormatter.format(segment.event.start)} to ${timeFormatter.format(segment.event.end)}`,
|
|
29778
|
-
title: segment.event.source.title
|
|
30032
|
+
title: `${segment.event.source.title} \xB7 ${timeFormatter.format(segment.event.start)} \u2013 ${timeFormatter.format(segment.event.end)}`,
|
|
29779
30033
|
style: {
|
|
29780
30034
|
top: `${top}%`,
|
|
29781
30035
|
height: `${Math.max(height, 2)}%`,
|
|
@@ -29832,7 +30086,7 @@ function Scheduler({
|
|
|
29832
30086
|
// gantt/gantt.tsx
|
|
29833
30087
|
import {
|
|
29834
30088
|
useMemo as useMemo20,
|
|
29835
|
-
useState as
|
|
30089
|
+
useState as useState71
|
|
29836
30090
|
} from "react";
|
|
29837
30091
|
import { jsx as jsx114, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
29838
30092
|
function startOfDay4(date) {
|
|
@@ -29944,10 +30198,10 @@ function Gantt({
|
|
|
29944
30198
|
"aria-label": ariaLabel = "Project timeline"
|
|
29945
30199
|
}) {
|
|
29946
30200
|
const scaleControlled = scale !== void 0;
|
|
29947
|
-
const [internalScale, setInternalScale] =
|
|
30201
|
+
const [internalScale, setInternalScale] = useState71(defaultScale);
|
|
29948
30202
|
const resolvedScale = scale ?? internalScale;
|
|
29949
30203
|
const zoomControlled = zoom !== void 0;
|
|
29950
|
-
const [internalZoom, setInternalZoom] =
|
|
30204
|
+
const [internalZoom, setInternalZoom] = useState71(
|
|
29951
30205
|
() => clampZoom(defaultZoom)
|
|
29952
30206
|
);
|
|
29953
30207
|
const resolvedZoom = clampZoom(
|
|
@@ -30000,7 +30254,7 @@ function Gantt({
|
|
|
30000
30254
|
};
|
|
30001
30255
|
}, [normalised, resolvedScale]);
|
|
30002
30256
|
const startControlled = start !== void 0;
|
|
30003
|
-
const [internalStart, setInternalStart] =
|
|
30257
|
+
const [internalStart, setInternalStart] = useState71(
|
|
30004
30258
|
() => defaultStart ? startOfDay4(defaultStart) : null
|
|
30005
30259
|
);
|
|
30006
30260
|
const viewStart = start ? startOfDay4(start) : internalStart ?? derivedRange.start;
|
|
@@ -30578,14 +30832,20 @@ function Gantt({
|
|
|
30578
30832
|
{
|
|
30579
30833
|
className: "pimolu-gantt__task",
|
|
30580
30834
|
role: "rowheader",
|
|
30581
|
-
children: /* @__PURE__ */
|
|
30835
|
+
children: /* @__PURE__ */ jsxs87(
|
|
30582
30836
|
"button",
|
|
30583
30837
|
{
|
|
30584
30838
|
type: "button",
|
|
30585
30839
|
className: "pimolu-gantt__task-button",
|
|
30586
30840
|
"aria-label": `View ${task.source.name}`,
|
|
30587
30841
|
onClick: () => onTaskClick?.(task.source),
|
|
30588
|
-
children:
|
|
30842
|
+
children: [
|
|
30843
|
+
/* @__PURE__ */ jsx114("span", { className: "pimolu-gantt__task-name", children: task.source.name }),
|
|
30844
|
+
/* @__PURE__ */ jsxs87("span", { className: "pimolu-gantt__task-completion", "aria-hidden": "true", children: [
|
|
30845
|
+
Math.round(task.progress),
|
|
30846
|
+
"%"
|
|
30847
|
+
] })
|
|
30848
|
+
]
|
|
30589
30849
|
}
|
|
30590
30850
|
)
|
|
30591
30851
|
}
|
|
@@ -30732,8 +30992,8 @@ function Gantt({
|
|
|
30732
30992
|
import {
|
|
30733
30993
|
Fragment as Fragment22,
|
|
30734
30994
|
useMemo as useMemo21,
|
|
30735
|
-
useRef as
|
|
30736
|
-
useState as
|
|
30995
|
+
useRef as useRef64,
|
|
30996
|
+
useState as useState72
|
|
30737
30997
|
} from "react";
|
|
30738
30998
|
import { Fragment as Fragment23, jsx as jsx115, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
30739
30999
|
function buildModel(input) {
|
|
@@ -30984,24 +31244,24 @@ function FileManager({
|
|
|
30984
31244
|
[entries]
|
|
30985
31245
|
);
|
|
30986
31246
|
const viewControlled = view !== void 0;
|
|
30987
|
-
const [internalView, setInternalView] =
|
|
31247
|
+
const [internalView, setInternalView] = useState72(defaultView);
|
|
30988
31248
|
const resolvedView = view ?? internalView;
|
|
30989
31249
|
const selectionControlled = selected !== void 0;
|
|
30990
|
-
const [internalSelection, setInternalSelection] =
|
|
31250
|
+
const [internalSelection, setInternalSelection] = useState72(() => [...defaultSelected]);
|
|
30991
31251
|
const selectedIds = [
|
|
30992
31252
|
...selected ?? internalSelection
|
|
30993
31253
|
];
|
|
30994
31254
|
const pathControlled = path !== void 0;
|
|
30995
|
-
const [internalPath, setInternalPath] =
|
|
31255
|
+
const [internalPath, setInternalPath] = useState72(() => [...defaultPath]);
|
|
30996
31256
|
const searchControlled = search !== void 0;
|
|
30997
|
-
const [internalSearch, setInternalSearch] =
|
|
31257
|
+
const [internalSearch, setInternalSearch] = useState72(defaultSearch);
|
|
30998
31258
|
const searchValue = search ?? internalSearch;
|
|
30999
31259
|
const sortControlled = sort !== void 0;
|
|
31000
|
-
const [internalSort, setInternalSort] =
|
|
31260
|
+
const [internalSort, setInternalSort] = useState72(defaultSort);
|
|
31001
31261
|
const resolvedSort = sort ?? internalSort;
|
|
31002
|
-
const [anchorId, setAnchorId] =
|
|
31003
|
-
const [focusedId, setFocusedId] =
|
|
31004
|
-
const itemsRef =
|
|
31262
|
+
const [anchorId, setAnchorId] = useState72(null);
|
|
31263
|
+
const [focusedId, setFocusedId] = useState72(null);
|
|
31264
|
+
const itemsRef = useRef64(null);
|
|
31005
31265
|
const currentPath = useMemo21(() => {
|
|
31006
31266
|
const result = [];
|
|
31007
31267
|
(path ?? internalPath).forEach((id) => {
|
|
@@ -31487,6 +31747,23 @@ import {
|
|
|
31487
31747
|
Fragment as Fragment24,
|
|
31488
31748
|
forwardRef as forwardRef66
|
|
31489
31749
|
} from "react";
|
|
31750
|
+
|
|
31751
|
+
// page-header/page-header.variants.ts
|
|
31752
|
+
import { createVariants as createVariants40 } from "@pimolu/core";
|
|
31753
|
+
var pageHeaderVariantMap = {
|
|
31754
|
+
size: {
|
|
31755
|
+
sm: "pimolu-page-header--sm",
|
|
31756
|
+
md: "pimolu-page-header--md",
|
|
31757
|
+
lg: "pimolu-page-header--lg"
|
|
31758
|
+
}
|
|
31759
|
+
};
|
|
31760
|
+
var pageHeaderVariants = createVariants40({
|
|
31761
|
+
base: "pimolu-page-header",
|
|
31762
|
+
variants: pageHeaderVariantMap,
|
|
31763
|
+
defaultVariants: { size: "md" }
|
|
31764
|
+
});
|
|
31765
|
+
|
|
31766
|
+
// page-header/page-header.tsx
|
|
31490
31767
|
import { jsx as jsx116, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
31491
31768
|
function classes31(base, ...extra) {
|
|
31492
31769
|
return [base, ...extra].filter(Boolean).join(" ");
|
|
@@ -31505,6 +31782,7 @@ var PageHeader = forwardRef66(function PageHeader2({
|
|
|
31505
31782
|
breadcrumbs,
|
|
31506
31783
|
meta,
|
|
31507
31784
|
align = "start",
|
|
31785
|
+
size = "md",
|
|
31508
31786
|
className,
|
|
31509
31787
|
...props
|
|
31510
31788
|
}, ref) {
|
|
@@ -31519,8 +31797,9 @@ var PageHeader = forwardRef66(function PageHeader2({
|
|
|
31519
31797
|
...props,
|
|
31520
31798
|
ref,
|
|
31521
31799
|
"data-align": align,
|
|
31800
|
+
"data-size": size,
|
|
31522
31801
|
className: classes31(
|
|
31523
|
-
|
|
31802
|
+
pageHeaderVariants({ size }),
|
|
31524
31803
|
align === "center" && "pimolu-page-header--center",
|
|
31525
31804
|
className
|
|
31526
31805
|
),
|
|
@@ -31548,7 +31827,7 @@ var PageHeader = forwardRef66(function PageHeader2({
|
|
|
31548
31827
|
PageHeader.displayName = "PimoluPageHeader";
|
|
31549
31828
|
|
|
31550
31829
|
// footer/footer.variants.ts
|
|
31551
|
-
import { createVariants as
|
|
31830
|
+
import { createVariants as createVariants41 } from "@pimolu/core";
|
|
31552
31831
|
var footerVariantMap = {
|
|
31553
31832
|
appearance: {
|
|
31554
31833
|
surface: "pimolu-footer--surface",
|
|
@@ -31556,10 +31835,10 @@ var footerVariantMap = {
|
|
|
31556
31835
|
floating: "pimolu-footer--floating"
|
|
31557
31836
|
}
|
|
31558
31837
|
};
|
|
31559
|
-
var footerVariants =
|
|
31838
|
+
var footerVariants = createVariants41({ base: "pimolu-footer", variants: footerVariantMap, defaultVariants: { appearance: "surface" } });
|
|
31560
31839
|
|
|
31561
31840
|
// footer/footer.tsx
|
|
31562
|
-
import { useId as
|
|
31841
|
+
import { useId as useId58 } from "react";
|
|
31563
31842
|
import { jsx as jsx117, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
31564
31843
|
function Footer({
|
|
31565
31844
|
appearance = "surface",
|
|
@@ -31573,7 +31852,7 @@ function Footer({
|
|
|
31573
31852
|
className,
|
|
31574
31853
|
...props
|
|
31575
31854
|
}) {
|
|
31576
|
-
const id =
|
|
31855
|
+
const id = useId58().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
31577
31856
|
const hasBrand = brand != null || description != null || actions != null;
|
|
31578
31857
|
const hasBottom = copyright != null || bottom != null;
|
|
31579
31858
|
return /* @__PURE__ */ jsxs90(
|
|
@@ -31646,7 +31925,7 @@ function Footer({
|
|
|
31646
31925
|
|
|
31647
31926
|
// docs-layout/docs-layout.tsx
|
|
31648
31927
|
import {
|
|
31649
|
-
useId as
|
|
31928
|
+
useId as useId59
|
|
31650
31929
|
} from "react";
|
|
31651
31930
|
import { jsx as jsx118, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
31652
31931
|
function classes32(base, ...extra) {
|
|
@@ -31665,7 +31944,7 @@ function DocsLayout({
|
|
|
31665
31944
|
style,
|
|
31666
31945
|
...props
|
|
31667
31946
|
}) {
|
|
31668
|
-
const mainId = `pimolu-docs-main-${
|
|
31947
|
+
const mainId = `pimolu-docs-main-${useId59().replace(
|
|
31669
31948
|
/[^a-zA-Z0-9_-]/g,
|
|
31670
31949
|
""
|
|
31671
31950
|
)}`;
|
|
@@ -31739,7 +32018,7 @@ function DocsLayout({
|
|
|
31739
32018
|
DocsLayout.displayName = "PimoluDocsLayout";
|
|
31740
32019
|
|
|
31741
32020
|
// table-of-contents/table-of-contents.tsx
|
|
31742
|
-
import { useId as
|
|
32021
|
+
import { useId as useId60 } from "react";
|
|
31743
32022
|
import { jsx as jsx119, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
31744
32023
|
function classes33(base, ...extra) {
|
|
31745
32024
|
return [base, ...extra].filter(Boolean).join(" ");
|
|
@@ -31766,7 +32045,7 @@ function TableOfContents({
|
|
|
31766
32045
|
"aria-labelledby": ariaLabelledBy,
|
|
31767
32046
|
...props
|
|
31768
32047
|
}) {
|
|
31769
|
-
const titleId = `pimolu-toc-${
|
|
32048
|
+
const titleId = `pimolu-toc-${useId60().replace(
|
|
31770
32049
|
/[^a-zA-Z0-9_-]/g,
|
|
31771
32050
|
""
|
|
31772
32051
|
)}`;
|
|
@@ -31829,9 +32108,9 @@ TableOfContents.displayName = "PimoluTableOfContents";
|
|
|
31829
32108
|
|
|
31830
32109
|
// anchor/anchor.tsx
|
|
31831
32110
|
import {
|
|
31832
|
-
useEffect as
|
|
31833
|
-
useRef as
|
|
31834
|
-
useState as
|
|
32111
|
+
useEffect as useEffect54,
|
|
32112
|
+
useRef as useRef65,
|
|
32113
|
+
useState as useState73
|
|
31835
32114
|
} from "react";
|
|
31836
32115
|
import { jsx as jsx120, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
31837
32116
|
function classes34(base, ...extra) {
|
|
@@ -31854,9 +32133,9 @@ function Anchor({
|
|
|
31854
32133
|
className,
|
|
31855
32134
|
...props
|
|
31856
32135
|
}) {
|
|
31857
|
-
const [copied, setCopied] =
|
|
31858
|
-
const feedbackTimer =
|
|
31859
|
-
|
|
32136
|
+
const [copied, setCopied] = useState73(false);
|
|
32137
|
+
const feedbackTimer = useRef65(void 0);
|
|
32138
|
+
useEffect54(
|
|
31860
32139
|
() => () => {
|
|
31861
32140
|
if (feedbackTimer.current !== void 0) {
|
|
31862
32141
|
clearTimeout(feedbackTimer.current);
|
|
@@ -31973,7 +32252,7 @@ var Prose = forwardRef67(function Prose2({
|
|
|
31973
32252
|
Prose.displayName = "PimoluProse";
|
|
31974
32253
|
|
|
31975
32254
|
// api-table/api-table.tsx
|
|
31976
|
-
import { useId as
|
|
32255
|
+
import { useId as useId61 } from "react";
|
|
31977
32256
|
import { jsx as jsx122, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
31978
32257
|
function classes36(base, ...extra) {
|
|
31979
32258
|
return [base, ...extra].filter(Boolean).join(" ");
|
|
@@ -31987,7 +32266,7 @@ function ApiTable({
|
|
|
31987
32266
|
className,
|
|
31988
32267
|
...props
|
|
31989
32268
|
}) {
|
|
31990
|
-
const titleId = `pimolu-api-table-${
|
|
32269
|
+
const titleId = `pimolu-api-table-${useId61().replace(
|
|
31991
32270
|
/[^a-zA-Z0-9_-]/g,
|
|
31992
32271
|
""
|
|
31993
32272
|
)}`;
|
|
@@ -32084,9 +32363,9 @@ ApiTable.displayName = "PimoluApiTable";
|
|
|
32084
32363
|
import {
|
|
32085
32364
|
Fragment as Fragment25,
|
|
32086
32365
|
forwardRef as forwardRef68,
|
|
32087
|
-
useEffect as
|
|
32366
|
+
useEffect as useEffect55,
|
|
32088
32367
|
useMemo as useMemo22,
|
|
32089
|
-
useState as
|
|
32368
|
+
useState as useState74
|
|
32090
32369
|
} from "react";
|
|
32091
32370
|
|
|
32092
32371
|
// code-block/code-block.types.ts
|
|
@@ -32718,7 +32997,7 @@ var CodeBlock = forwardRef68(function CodeBlock2({
|
|
|
32718
32997
|
className,
|
|
32719
32998
|
...props
|
|
32720
32999
|
}, ref) {
|
|
32721
|
-
const [copyStatus, setCopyStatus] =
|
|
33000
|
+
const [copyStatus, setCopyStatus] = useState74("idle");
|
|
32722
33001
|
const lines = useMemo22(
|
|
32723
33002
|
() => tokenizeLines(code, language),
|
|
32724
33003
|
[code, language]
|
|
@@ -32731,7 +33010,7 @@ var CodeBlock = forwardRef68(function CodeBlock2({
|
|
|
32731
33010
|
),
|
|
32732
33011
|
[highlightLines]
|
|
32733
33012
|
);
|
|
32734
|
-
|
|
33013
|
+
useEffect55(() => {
|
|
32735
33014
|
if (copyStatus === "idle") return;
|
|
32736
33015
|
const timer = window.setTimeout(() => {
|
|
32737
33016
|
setCopyStatus("idle");
|
|
@@ -32840,8 +33119,8 @@ CodeBlock.displayName = "PimoluCodeBlock";
|
|
|
32840
33119
|
// search-input/search-input.tsx
|
|
32841
33120
|
import {
|
|
32842
33121
|
forwardRef as forwardRef69,
|
|
32843
|
-
useRef as
|
|
32844
|
-
useState as
|
|
33122
|
+
useRef as useRef66,
|
|
33123
|
+
useState as useState75
|
|
32845
33124
|
} from "react";
|
|
32846
33125
|
|
|
32847
33126
|
// search-input/search-input.types.ts
|
|
@@ -32893,9 +33172,9 @@ var SearchInput = forwardRef69(function SearchInput2({
|
|
|
32893
33172
|
autoFocus,
|
|
32894
33173
|
id
|
|
32895
33174
|
}, forwardedRef) {
|
|
32896
|
-
const inputRef =
|
|
33175
|
+
const inputRef = useRef66(null);
|
|
32897
33176
|
const isControlled = value !== void 0;
|
|
32898
|
-
const [internalValue, setInternalValue] =
|
|
33177
|
+
const [internalValue, setInternalValue] = useState75(
|
|
32899
33178
|
() => defaultValue ?? ""
|
|
32900
33179
|
);
|
|
32901
33180
|
const currentValue = isControlled ? value : internalValue;
|
|
@@ -32978,10 +33257,10 @@ SearchInput.displayName = "PimoluSearchInput";
|
|
|
32978
33257
|
// theme-builder/theme-builder.tsx
|
|
32979
33258
|
import {
|
|
32980
33259
|
forwardRef as forwardRef70,
|
|
32981
|
-
useEffect as
|
|
32982
|
-
useId as
|
|
32983
|
-
useRef as
|
|
32984
|
-
useState as
|
|
33260
|
+
useEffect as useEffect56,
|
|
33261
|
+
useId as useId62,
|
|
33262
|
+
useRef as useRef67,
|
|
33263
|
+
useState as useState76
|
|
32985
33264
|
} from "react";
|
|
32986
33265
|
|
|
32987
33266
|
// theme-builder/theme-builder.types.ts
|
|
@@ -33000,7 +33279,7 @@ var DEFAULT_THEME_BUILDER_BRAND_COLOR = "#5B55E7";
|
|
|
33000
33279
|
// theme-builder/theme-builder.tsx
|
|
33001
33280
|
import { jsx as jsx125, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
33002
33281
|
function useControllableState(controlled, defaultValue) {
|
|
33003
|
-
const [internalValue, setInternalValue] =
|
|
33282
|
+
const [internalValue, setInternalValue] = useState76(defaultValue);
|
|
33004
33283
|
const isControlled = controlled !== void 0;
|
|
33005
33284
|
return {
|
|
33006
33285
|
value: isControlled ? controlled : internalValue,
|
|
@@ -33090,9 +33369,9 @@ var ThemeBuilder = forwardRef70(function ThemeBuilder2({
|
|
|
33090
33369
|
className,
|
|
33091
33370
|
...props
|
|
33092
33371
|
}, ref) {
|
|
33093
|
-
const presetLabelId =
|
|
33094
|
-
const themeLabelId =
|
|
33095
|
-
const colorId =
|
|
33372
|
+
const presetLabelId = useId62();
|
|
33373
|
+
const themeLabelId = useId62();
|
|
33374
|
+
const colorId = useId62();
|
|
33096
33375
|
const presetState = useControllableState(
|
|
33097
33376
|
value,
|
|
33098
33377
|
defaultValue ?? presets[0]?.id ?? ""
|
|
@@ -33113,7 +33392,7 @@ var ThemeBuilder = forwardRef70(function ThemeBuilder2({
|
|
|
33113
33392
|
density,
|
|
33114
33393
|
"comfortable"
|
|
33115
33394
|
);
|
|
33116
|
-
const presetRefs =
|
|
33395
|
+
const presetRefs = useRef67([]);
|
|
33117
33396
|
const presetId = presetState.value;
|
|
33118
33397
|
const currentTheme = themeState.value;
|
|
33119
33398
|
const currentBrand = brandState.value;
|
|
@@ -33122,7 +33401,7 @@ var ThemeBuilder = forwardRef70(function ThemeBuilder2({
|
|
|
33122
33401
|
const selectedPreset = presets.find(
|
|
33123
33402
|
(entry) => entry.id === presetId
|
|
33124
33403
|
);
|
|
33125
|
-
|
|
33404
|
+
useEffect56(() => {
|
|
33126
33405
|
if (presetState.isControlled) return;
|
|
33127
33406
|
if (presets.some((entry) => entry.id === presetId)) {
|
|
33128
33407
|
return;
|
|
@@ -33564,14 +33843,14 @@ SplitButton.displayName = "PimoluSplitButton";
|
|
|
33564
33843
|
import {
|
|
33565
33844
|
forwardRef as forwardRef73,
|
|
33566
33845
|
useCallback as useCallback32,
|
|
33567
|
-
useEffect as
|
|
33568
|
-
useId as
|
|
33846
|
+
useEffect as useEffect57,
|
|
33847
|
+
useId as useId63,
|
|
33569
33848
|
useLayoutEffect as useLayoutEffect6,
|
|
33570
|
-
useRef as
|
|
33571
|
-
useState as
|
|
33849
|
+
useRef as useRef68,
|
|
33850
|
+
useState as useState77
|
|
33572
33851
|
} from "react";
|
|
33573
33852
|
import { Fragment as Fragment26, jsx as jsx128, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
33574
|
-
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? useLayoutEffect6 :
|
|
33853
|
+
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? useLayoutEffect6 : useEffect57;
|
|
33575
33854
|
function VisibilityIcon({
|
|
33576
33855
|
visible
|
|
33577
33856
|
}) {
|
|
@@ -33623,14 +33902,14 @@ var PasswordInput = forwardRef73(function PasswordInput2({
|
|
|
33623
33902
|
"aria-describedby": ariaDescribedBy,
|
|
33624
33903
|
...props
|
|
33625
33904
|
}, forwardedRef) {
|
|
33626
|
-
const generatedId =
|
|
33905
|
+
const generatedId = useId63();
|
|
33627
33906
|
const inputId = id ?? `pimolu-password-input-${generatedId}`;
|
|
33628
|
-
const inputRef =
|
|
33629
|
-
const selectionRef =
|
|
33907
|
+
const inputRef = useRef68(null);
|
|
33908
|
+
const selectionRef = useRef68(
|
|
33630
33909
|
null
|
|
33631
33910
|
);
|
|
33632
33911
|
const isControlled = value !== void 0;
|
|
33633
|
-
const [visible, setVisible] =
|
|
33912
|
+
const [visible, setVisible] = useState77(false);
|
|
33634
33913
|
const setInputRef = useCallback32(
|
|
33635
33914
|
(node) => {
|
|
33636
33915
|
inputRef.current = node;
|
|
@@ -33896,10 +34175,10 @@ InputGroupButton.displayName = "PimoluInputGroupButton";
|
|
|
33896
34175
|
import {
|
|
33897
34176
|
forwardRef as forwardRef75,
|
|
33898
34177
|
useCallback as useCallback33,
|
|
33899
|
-
useEffect as
|
|
33900
|
-
useId as
|
|
33901
|
-
useRef as
|
|
33902
|
-
useState as
|
|
34178
|
+
useEffect as useEffect58,
|
|
34179
|
+
useId as useId64,
|
|
34180
|
+
useRef as useRef69,
|
|
34181
|
+
useState as useState78
|
|
33903
34182
|
} from "react";
|
|
33904
34183
|
import { jsx as jsx130, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
33905
34184
|
function flattenTree(options, isExpanded, forceExpand = false, level = 1, path = []) {
|
|
@@ -33990,17 +34269,17 @@ var TreeSelect = forwardRef75(function TreeSelect2({
|
|
|
33990
34269
|
"aria-labelledby": ariaLabelledBy,
|
|
33991
34270
|
"aria-describedby": ariaDescribedBy
|
|
33992
34271
|
}, forwardedRef) {
|
|
33993
|
-
const generatedId =
|
|
34272
|
+
const generatedId = useId64();
|
|
33994
34273
|
const triggerId = id ?? `pimolu-tree-select-${generatedId}`;
|
|
33995
34274
|
const labelId = `${triggerId}-label`;
|
|
33996
34275
|
const treeId = `${triggerId}-tree`;
|
|
33997
34276
|
const searchId = `${triggerId}-search`;
|
|
33998
34277
|
const errorId = error ? `${triggerId}-error` : void 0;
|
|
33999
|
-
const rootRef =
|
|
34000
|
-
const fieldRef =
|
|
34001
|
-
const triggerRef =
|
|
34002
|
-
const panelRef =
|
|
34003
|
-
const typeaheadRef =
|
|
34278
|
+
const rootRef = useRef69(null);
|
|
34279
|
+
const fieldRef = useRef69(null);
|
|
34280
|
+
const triggerRef = useRef69(null);
|
|
34281
|
+
const panelRef = useRef69(null);
|
|
34282
|
+
const typeaheadRef = useRef69({
|
|
34004
34283
|
text: "",
|
|
34005
34284
|
time: 0
|
|
34006
34285
|
});
|
|
@@ -34016,12 +34295,12 @@ var TreeSelect = forwardRef75(function TreeSelect2({
|
|
|
34016
34295
|
[forwardedRef]
|
|
34017
34296
|
);
|
|
34018
34297
|
const isControlled = value !== void 0;
|
|
34019
|
-
const [internalValue, setInternalValue] =
|
|
34298
|
+
const [internalValue, setInternalValue] = useState78(defaultValue);
|
|
34020
34299
|
const currentValue = isControlled ? value : internalValue;
|
|
34021
|
-
const [isOpen, setIsOpen] =
|
|
34022
|
-
const [query, setQuery] =
|
|
34023
|
-
const [activeValue, setActiveValue] =
|
|
34024
|
-
const [expandedValues, setExpandedValues] =
|
|
34300
|
+
const [isOpen, setIsOpen] = useState78(false);
|
|
34301
|
+
const [query, setQuery] = useState78("");
|
|
34302
|
+
const [activeValue, setActiveValue] = useState78(null);
|
|
34303
|
+
const [expandedValues, setExpandedValues] = useState78(() => {
|
|
34025
34304
|
const path = defaultValue !== void 0 ? findPath(options, defaultValue) : null;
|
|
34026
34305
|
return new Set(path?.slice(0, -1) ?? []);
|
|
34027
34306
|
});
|
|
@@ -34268,7 +34547,7 @@ var TreeSelect = forwardRef75(function TreeSelect2({
|
|
|
34268
34547
|
onDismiss: () => closePanel(false),
|
|
34269
34548
|
closeOnEscape: false
|
|
34270
34549
|
});
|
|
34271
|
-
|
|
34550
|
+
useEffect58(() => {
|
|
34272
34551
|
if (!isOpen || !activeValue) return;
|
|
34273
34552
|
panelRef.current?.querySelector(
|
|
34274
34553
|
'[data-active="true"]'
|
|
@@ -34546,14 +34825,14 @@ TreeSelect.displayName = "PimoluTreeSelect";
|
|
|
34546
34825
|
import {
|
|
34547
34826
|
forwardRef as forwardRef76,
|
|
34548
34827
|
useCallback as useCallback34,
|
|
34549
|
-
useEffect as
|
|
34550
|
-
useId as
|
|
34828
|
+
useEffect as useEffect59,
|
|
34829
|
+
useId as useId65,
|
|
34551
34830
|
useLayoutEffect as useLayoutEffect7,
|
|
34552
|
-
useRef as
|
|
34553
|
-
useState as
|
|
34831
|
+
useRef as useRef70,
|
|
34832
|
+
useState as useState79
|
|
34554
34833
|
} from "react";
|
|
34555
34834
|
import { jsx as jsx131, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
34556
|
-
var useIsomorphicLayoutEffect3 = typeof window !== "undefined" ? useLayoutEffect7 :
|
|
34835
|
+
var useIsomorphicLayoutEffect3 = typeof window !== "undefined" ? useLayoutEffect7 : useEffect59;
|
|
34557
34836
|
function clamp14(value, min, max) {
|
|
34558
34837
|
return Math.min(Math.max(value, min), max);
|
|
34559
34838
|
}
|
|
@@ -34652,19 +34931,19 @@ var Signature = forwardRef76(function Signature2({
|
|
|
34652
34931
|
const safeWidth = Number.isFinite(width) && width > 0 ? width : 600;
|
|
34653
34932
|
const safeHeight = Number.isFinite(height) && height > 0 ? height : 200;
|
|
34654
34933
|
const safeLineWidth = Number.isFinite(lineWidth) && lineWidth > 0 ? lineWidth : 2;
|
|
34655
|
-
const generatedId =
|
|
34934
|
+
const generatedId = useId65();
|
|
34656
34935
|
const baseId = id ?? `pimolu-signature-${generatedId}`;
|
|
34657
34936
|
const canvasId = `${baseId}-canvas`;
|
|
34658
34937
|
const labelId = label ? `${baseId}-label` : void 0;
|
|
34659
34938
|
const descriptionId = description ? `${baseId}-description` : void 0;
|
|
34660
34939
|
const instructionsId = `${baseId}-instructions`;
|
|
34661
|
-
const canvasRef =
|
|
34662
|
-
const drawingRef =
|
|
34663
|
-
const strokesRef =
|
|
34664
|
-
const baseImageRef =
|
|
34940
|
+
const canvasRef = useRef70(null);
|
|
34941
|
+
const drawingRef = useRef70(null);
|
|
34942
|
+
const strokesRef = useRef70([]);
|
|
34943
|
+
const baseImageRef = useRef70(
|
|
34665
34944
|
defaultValue ?? null
|
|
34666
34945
|
);
|
|
34667
|
-
const lastEmittedRef =
|
|
34946
|
+
const lastEmittedRef = useRef70(void 0);
|
|
34668
34947
|
const assignRef = useCallback34(
|
|
34669
34948
|
(node) => {
|
|
34670
34949
|
canvasRef.current = node;
|
|
@@ -34677,15 +34956,15 @@ var Signature = forwardRef76(function Signature2({
|
|
|
34677
34956
|
[forwardedRef]
|
|
34678
34957
|
);
|
|
34679
34958
|
const isControlled = value !== void 0;
|
|
34680
|
-
const [internalValue, setInternalValue] =
|
|
34681
|
-
const [history, setHistory] =
|
|
34682
|
-
const [hasInk, setHasInk] =
|
|
34959
|
+
const [internalValue, setInternalValue] = useState79(defaultValue ?? null);
|
|
34960
|
+
const [history, setHistory] = useState79(() => [defaultValue ?? null]);
|
|
34961
|
+
const [hasInk, setHasInk] = useState79(
|
|
34683
34962
|
Boolean(defaultValue)
|
|
34684
34963
|
);
|
|
34685
|
-
const [revision, setRevision] =
|
|
34686
|
-
const [pixelRatio, setPixelRatio] =
|
|
34964
|
+
const [revision, setRevision] = useState79(0);
|
|
34965
|
+
const [pixelRatio, setPixelRatio] = useState79(1);
|
|
34687
34966
|
const currentValue = isControlled ? value ?? null : internalValue;
|
|
34688
|
-
|
|
34967
|
+
useEffect59(() => {
|
|
34689
34968
|
if (typeof window === "undefined") return;
|
|
34690
34969
|
const ratio = Number(window.devicePixelRatio);
|
|
34691
34970
|
if (!Number.isFinite(ratio) || ratio <= 0) return;
|
|
@@ -34709,7 +34988,7 @@ var Signature = forwardRef76(function Signature2({
|
|
|
34709
34988
|
canvas.height = nextHeight;
|
|
34710
34989
|
}
|
|
34711
34990
|
}, [safeWidth, safeHeight, pixelRatio]);
|
|
34712
|
-
|
|
34991
|
+
useEffect59(() => {
|
|
34713
34992
|
const canvas = canvasRef.current;
|
|
34714
34993
|
if (!canvas) return;
|
|
34715
34994
|
const context = getContext(canvas);
|
|
@@ -34763,7 +35042,7 @@ var Signature = forwardRef76(function Signature2({
|
|
|
34763
35042
|
currentValue,
|
|
34764
35043
|
revision
|
|
34765
35044
|
]);
|
|
34766
|
-
|
|
35045
|
+
useEffect59(() => {
|
|
34767
35046
|
if (!isControlled) return;
|
|
34768
35047
|
const next = value ?? null;
|
|
34769
35048
|
if (next === lastEmittedRef.current) return;
|
|
@@ -35594,6 +35873,7 @@ export {
|
|
|
35594
35873
|
multiSelectVariantMap,
|
|
35595
35874
|
navbarVariantMap,
|
|
35596
35875
|
normalizeHexColor,
|
|
35876
|
+
pageHeaderVariantMap,
|
|
35597
35877
|
paginationVariantMap,
|
|
35598
35878
|
popoverVariantMap,
|
|
35599
35879
|
progressVariantMap,
|