@k3-universe/react-kit 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1169 -1145
- package/dist/kit/builder/form/components/FormBuilder.d.ts +1 -1
- package/dist/kit/builder/form/components/FormBuilder.d.ts.map +1 -1
- package/dist/kit/builder/form/components/FormBuilderContext.d.ts +18 -0
- package/dist/kit/builder/form/components/FormBuilderContext.d.ts.map +1 -0
- package/dist/kit/builder/form/components/sectionNodes.d.ts +17 -0
- package/dist/kit/builder/form/components/sectionNodes.d.ts.map +1 -0
- package/dist/kit/builder/form/types.d.ts +4 -3
- package/dist/kit/builder/form/types.d.ts.map +1 -1
- package/dist/kit/themes/clean-slate.css +3 -3
- package/dist/kit/themes/default.css +4 -4
- package/dist/kit/themes/minimal-modern.css +3 -3
- package/dist/kit/themes/spotify.css +3 -3
- package/package.json +1 -1
- package/src/kit/builder/form/components/FormBuilder.tsx +77 -139
- package/src/kit/builder/form/components/FormBuilderContext.tsx +45 -0
- package/src/kit/builder/form/components/sectionNodes.tsx +116 -0
- package/src/kit/builder/form/types.ts +4 -2
- package/src/kit/components/autocomplete/Autocomplete.tsx +1 -1
- package/src/kit/themes/default.css +1 -1
- package/src/shadcn/ui/button.tsx +1 -1
- package/src/shadcn/ui/command.tsx +1 -1
- package/src/shadcn/ui/input.tsx +1 -1
- package/src/shadcn/ui/popover.tsx +1 -1
- package/src/shadcn/ui/select.tsx +1 -1
- package/src/shadcn/ui/textarea.tsx +1 -1
- package/src/stories/kit/builder/Form.MultipleFormBuilder.stories.tsx +335 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, { forwardRef, createElement, useLayoutEffect, useState, useRef, useCallback, useEffect, useMemo, useId as useId$2, createContext, useContext, useReducer, useImperativeHandle, Fragment as Fragment$1,
|
|
3
|
+
import React__default, { forwardRef, createElement, memo as memo$1, useLayoutEffect, useState, useRef, useCallback, useEffect, useMemo, useId as useId$2, createContext, useContext, useReducer, useImperativeHandle, Fragment as Fragment$1, use, isValidElement, PureComponent, cloneElement } from "react";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
import ReactDOM__default from "react-dom";
|
|
6
6
|
import { useLocation, Link as Link$1 } from "@tanstack/react-router";
|
|
@@ -7609,7 +7609,7 @@ const buttonVariants = cva(
|
|
|
7609
7609
|
variant: {
|
|
7610
7610
|
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
7611
7611
|
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
7612
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-
|
|
7612
|
+
outline: "border border-border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-border dark:hover:bg-input/50",
|
|
7613
7613
|
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
7614
7614
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
7615
7615
|
link: "text-primary underline-offset-4 hover:underline"
|
|
@@ -13429,7 +13429,867 @@ function refine(fn, _params = {}) {
|
|
|
13429
13429
|
function superRefine(fn) {
|
|
13430
13430
|
return _superRefine(fn);
|
|
13431
13431
|
}
|
|
13432
|
-
|
|
13432
|
+
function Card({ className, ...props2 }) {
|
|
13433
|
+
return /* @__PURE__ */ jsx(
|
|
13434
|
+
"div",
|
|
13435
|
+
{
|
|
13436
|
+
"data-slot": "card",
|
|
13437
|
+
className: cn$1(
|
|
13438
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
13439
|
+
className
|
|
13440
|
+
),
|
|
13441
|
+
...props2
|
|
13442
|
+
}
|
|
13443
|
+
);
|
|
13444
|
+
}
|
|
13445
|
+
function CardHeader({ className, ...props2 }) {
|
|
13446
|
+
return /* @__PURE__ */ jsx(
|
|
13447
|
+
"div",
|
|
13448
|
+
{
|
|
13449
|
+
"data-slot": "card-header",
|
|
13450
|
+
className: cn$1(
|
|
13451
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
13452
|
+
className
|
|
13453
|
+
),
|
|
13454
|
+
...props2
|
|
13455
|
+
}
|
|
13456
|
+
);
|
|
13457
|
+
}
|
|
13458
|
+
function CardTitle({ className, ...props2 }) {
|
|
13459
|
+
return /* @__PURE__ */ jsx(
|
|
13460
|
+
"div",
|
|
13461
|
+
{
|
|
13462
|
+
"data-slot": "card-title",
|
|
13463
|
+
className: cn$1("leading-none font-semibold", className),
|
|
13464
|
+
...props2
|
|
13465
|
+
}
|
|
13466
|
+
);
|
|
13467
|
+
}
|
|
13468
|
+
function CardDescription({ className, ...props2 }) {
|
|
13469
|
+
return /* @__PURE__ */ jsx(
|
|
13470
|
+
"div",
|
|
13471
|
+
{
|
|
13472
|
+
"data-slot": "card-description",
|
|
13473
|
+
className: cn$1("text-muted-foreground text-sm", className),
|
|
13474
|
+
...props2
|
|
13475
|
+
}
|
|
13476
|
+
);
|
|
13477
|
+
}
|
|
13478
|
+
function CardAction({ className, ...props2 }) {
|
|
13479
|
+
return /* @__PURE__ */ jsx(
|
|
13480
|
+
"div",
|
|
13481
|
+
{
|
|
13482
|
+
"data-slot": "card-action",
|
|
13483
|
+
className: cn$1(
|
|
13484
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
13485
|
+
className
|
|
13486
|
+
),
|
|
13487
|
+
...props2
|
|
13488
|
+
}
|
|
13489
|
+
);
|
|
13490
|
+
}
|
|
13491
|
+
function CardContent({ className, ...props2 }) {
|
|
13492
|
+
return /* @__PURE__ */ jsx(
|
|
13493
|
+
"div",
|
|
13494
|
+
{
|
|
13495
|
+
"data-slot": "card-content",
|
|
13496
|
+
className: cn$1("px-6", className),
|
|
13497
|
+
...props2
|
|
13498
|
+
}
|
|
13499
|
+
);
|
|
13500
|
+
}
|
|
13501
|
+
function CardFooter({ className, ...props2 }) {
|
|
13502
|
+
return /* @__PURE__ */ jsx(
|
|
13503
|
+
"div",
|
|
13504
|
+
{
|
|
13505
|
+
"data-slot": "card-footer",
|
|
13506
|
+
className: cn$1("flex items-center px-6 [.border-t]:pt-6", className),
|
|
13507
|
+
...props2
|
|
13508
|
+
}
|
|
13509
|
+
);
|
|
13510
|
+
}
|
|
13511
|
+
var NAME$5 = "Separator";
|
|
13512
|
+
var DEFAULT_ORIENTATION = "horizontal";
|
|
13513
|
+
var ORIENTATIONS = ["horizontal", "vertical"];
|
|
13514
|
+
var Separator$3 = React.forwardRef((props2, forwardedRef) => {
|
|
13515
|
+
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props2;
|
|
13516
|
+
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
13517
|
+
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
13518
|
+
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
13519
|
+
return /* @__PURE__ */ jsx(
|
|
13520
|
+
Primitive.div,
|
|
13521
|
+
{
|
|
13522
|
+
"data-orientation": orientation,
|
|
13523
|
+
...semanticProps,
|
|
13524
|
+
...domProps,
|
|
13525
|
+
ref: forwardedRef
|
|
13526
|
+
}
|
|
13527
|
+
);
|
|
13528
|
+
});
|
|
13529
|
+
Separator$3.displayName = NAME$5;
|
|
13530
|
+
function isValidOrientation(orientation) {
|
|
13531
|
+
return ORIENTATIONS.includes(orientation);
|
|
13532
|
+
}
|
|
13533
|
+
var Root$e = Separator$3;
|
|
13534
|
+
function Separator$2({
|
|
13535
|
+
className,
|
|
13536
|
+
orientation = "horizontal",
|
|
13537
|
+
decorative = true,
|
|
13538
|
+
...props2
|
|
13539
|
+
}) {
|
|
13540
|
+
return /* @__PURE__ */ jsx(
|
|
13541
|
+
Root$e,
|
|
13542
|
+
{
|
|
13543
|
+
"data-slot": "separator",
|
|
13544
|
+
decorative,
|
|
13545
|
+
orientation,
|
|
13546
|
+
className: cn$1(
|
|
13547
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
13548
|
+
className
|
|
13549
|
+
),
|
|
13550
|
+
...props2
|
|
13551
|
+
}
|
|
13552
|
+
);
|
|
13553
|
+
}
|
|
13554
|
+
function useCallbackRef$2(callback) {
|
|
13555
|
+
const callbackRef = React.useRef(callback);
|
|
13556
|
+
React.useEffect(() => {
|
|
13557
|
+
callbackRef.current = callback;
|
|
13558
|
+
});
|
|
13559
|
+
return React.useMemo(() => (...args) => {
|
|
13560
|
+
var _a;
|
|
13561
|
+
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
13562
|
+
}, []);
|
|
13563
|
+
}
|
|
13564
|
+
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
13565
|
+
var EVENT_OPTIONS$1 = { bubbles: false, cancelable: true };
|
|
13566
|
+
var GROUP_NAME$5 = "RovingFocusGroup";
|
|
13567
|
+
var [Collection$5, useCollection$5, createCollectionScope$5] = createCollection(GROUP_NAME$5);
|
|
13568
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
13569
|
+
GROUP_NAME$5,
|
|
13570
|
+
[createCollectionScope$5]
|
|
13571
|
+
);
|
|
13572
|
+
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$5);
|
|
13573
|
+
var RovingFocusGroup = React.forwardRef(
|
|
13574
|
+
(props2, forwardedRef) => {
|
|
13575
|
+
return /* @__PURE__ */ jsx(Collection$5.Provider, { scope: props2.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection$5.Slot, { scope: props2.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props2, ref: forwardedRef }) }) });
|
|
13576
|
+
}
|
|
13577
|
+
);
|
|
13578
|
+
RovingFocusGroup.displayName = GROUP_NAME$5;
|
|
13579
|
+
var RovingFocusGroupImpl = React.forwardRef((props2, forwardedRef) => {
|
|
13580
|
+
const {
|
|
13581
|
+
__scopeRovingFocusGroup,
|
|
13582
|
+
orientation,
|
|
13583
|
+
loop = false,
|
|
13584
|
+
dir,
|
|
13585
|
+
currentTabStopId: currentTabStopIdProp,
|
|
13586
|
+
defaultCurrentTabStopId,
|
|
13587
|
+
onCurrentTabStopIdChange,
|
|
13588
|
+
onEntryFocus,
|
|
13589
|
+
preventScrollOnEntryFocus = false,
|
|
13590
|
+
...groupProps
|
|
13591
|
+
} = props2;
|
|
13592
|
+
const ref = React.useRef(null);
|
|
13593
|
+
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
13594
|
+
const direction = useDirection(dir);
|
|
13595
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState$1({
|
|
13596
|
+
prop: currentTabStopIdProp,
|
|
13597
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
13598
|
+
onChange: onCurrentTabStopIdChange,
|
|
13599
|
+
caller: GROUP_NAME$5
|
|
13600
|
+
});
|
|
13601
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
13602
|
+
const handleEntryFocus = useCallbackRef$2(onEntryFocus);
|
|
13603
|
+
const getItems = useCollection$5(__scopeRovingFocusGroup);
|
|
13604
|
+
const isClickFocusRef = React.useRef(false);
|
|
13605
|
+
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
13606
|
+
React.useEffect(() => {
|
|
13607
|
+
const node = ref.current;
|
|
13608
|
+
if (node) {
|
|
13609
|
+
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
13610
|
+
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
13611
|
+
}
|
|
13612
|
+
}, [handleEntryFocus]);
|
|
13613
|
+
return /* @__PURE__ */ jsx(
|
|
13614
|
+
RovingFocusProvider,
|
|
13615
|
+
{
|
|
13616
|
+
scope: __scopeRovingFocusGroup,
|
|
13617
|
+
orientation,
|
|
13618
|
+
dir: direction,
|
|
13619
|
+
loop,
|
|
13620
|
+
currentTabStopId,
|
|
13621
|
+
onItemFocus: React.useCallback(
|
|
13622
|
+
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
13623
|
+
[setCurrentTabStopId]
|
|
13624
|
+
),
|
|
13625
|
+
onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
|
|
13626
|
+
onFocusableItemAdd: React.useCallback(
|
|
13627
|
+
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
13628
|
+
[]
|
|
13629
|
+
),
|
|
13630
|
+
onFocusableItemRemove: React.useCallback(
|
|
13631
|
+
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
13632
|
+
[]
|
|
13633
|
+
),
|
|
13634
|
+
children: /* @__PURE__ */ jsx(
|
|
13635
|
+
Primitive.div,
|
|
13636
|
+
{
|
|
13637
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
13638
|
+
"data-orientation": orientation,
|
|
13639
|
+
...groupProps,
|
|
13640
|
+
ref: composedRefs,
|
|
13641
|
+
style: { outline: "none", ...props2.style },
|
|
13642
|
+
onMouseDown: composeEventHandlers$1(props2.onMouseDown, () => {
|
|
13643
|
+
isClickFocusRef.current = true;
|
|
13644
|
+
}),
|
|
13645
|
+
onFocus: composeEventHandlers$1(props2.onFocus, (event) => {
|
|
13646
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
13647
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
13648
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS$1);
|
|
13649
|
+
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
13650
|
+
if (!entryFocusEvent.defaultPrevented) {
|
|
13651
|
+
const items = getItems().filter((item) => item.focusable);
|
|
13652
|
+
const activeItem = items.find((item) => item.active);
|
|
13653
|
+
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
13654
|
+
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
13655
|
+
Boolean
|
|
13656
|
+
);
|
|
13657
|
+
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
13658
|
+
focusFirst$3(candidateNodes, preventScrollOnEntryFocus);
|
|
13659
|
+
}
|
|
13660
|
+
}
|
|
13661
|
+
isClickFocusRef.current = false;
|
|
13662
|
+
}),
|
|
13663
|
+
onBlur: composeEventHandlers$1(props2.onBlur, () => setIsTabbingBackOut(false))
|
|
13664
|
+
}
|
|
13665
|
+
)
|
|
13666
|
+
}
|
|
13667
|
+
);
|
|
13668
|
+
});
|
|
13669
|
+
var ITEM_NAME$8 = "RovingFocusGroupItem";
|
|
13670
|
+
var RovingFocusGroupItem = React.forwardRef(
|
|
13671
|
+
(props2, forwardedRef) => {
|
|
13672
|
+
const {
|
|
13673
|
+
__scopeRovingFocusGroup,
|
|
13674
|
+
focusable = true,
|
|
13675
|
+
active = false,
|
|
13676
|
+
tabStopId,
|
|
13677
|
+
children,
|
|
13678
|
+
...itemProps
|
|
13679
|
+
} = props2;
|
|
13680
|
+
const autoId = useId$1();
|
|
13681
|
+
const id = tabStopId || autoId;
|
|
13682
|
+
const context = useRovingFocusContext(ITEM_NAME$8, __scopeRovingFocusGroup);
|
|
13683
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
13684
|
+
const getItems = useCollection$5(__scopeRovingFocusGroup);
|
|
13685
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
13686
|
+
React.useEffect(() => {
|
|
13687
|
+
if (focusable) {
|
|
13688
|
+
onFocusableItemAdd();
|
|
13689
|
+
return () => onFocusableItemRemove();
|
|
13690
|
+
}
|
|
13691
|
+
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
13692
|
+
return /* @__PURE__ */ jsx(
|
|
13693
|
+
Collection$5.ItemSlot,
|
|
13694
|
+
{
|
|
13695
|
+
scope: __scopeRovingFocusGroup,
|
|
13696
|
+
id,
|
|
13697
|
+
focusable,
|
|
13698
|
+
active,
|
|
13699
|
+
children: /* @__PURE__ */ jsx(
|
|
13700
|
+
Primitive.span,
|
|
13701
|
+
{
|
|
13702
|
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
13703
|
+
"data-orientation": context.orientation,
|
|
13704
|
+
...itemProps,
|
|
13705
|
+
ref: forwardedRef,
|
|
13706
|
+
onMouseDown: composeEventHandlers$1(props2.onMouseDown, (event) => {
|
|
13707
|
+
if (!focusable) event.preventDefault();
|
|
13708
|
+
else context.onItemFocus(id);
|
|
13709
|
+
}),
|
|
13710
|
+
onFocus: composeEventHandlers$1(props2.onFocus, () => context.onItemFocus(id)),
|
|
13711
|
+
onKeyDown: composeEventHandlers$1(props2.onKeyDown, (event) => {
|
|
13712
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
13713
|
+
context.onItemShiftTab();
|
|
13714
|
+
return;
|
|
13715
|
+
}
|
|
13716
|
+
if (event.target !== event.currentTarget) return;
|
|
13717
|
+
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
13718
|
+
if (focusIntent !== void 0) {
|
|
13719
|
+
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
13720
|
+
event.preventDefault();
|
|
13721
|
+
const items = getItems().filter((item) => item.focusable);
|
|
13722
|
+
let candidateNodes = items.map((item) => item.ref.current);
|
|
13723
|
+
if (focusIntent === "last") candidateNodes.reverse();
|
|
13724
|
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
13725
|
+
if (focusIntent === "prev") candidateNodes.reverse();
|
|
13726
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
13727
|
+
candidateNodes = context.loop ? wrapArray$3(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
13728
|
+
}
|
|
13729
|
+
setTimeout(() => focusFirst$3(candidateNodes));
|
|
13730
|
+
}
|
|
13731
|
+
}),
|
|
13732
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
13733
|
+
}
|
|
13734
|
+
)
|
|
13735
|
+
}
|
|
13736
|
+
);
|
|
13737
|
+
}
|
|
13738
|
+
);
|
|
13739
|
+
RovingFocusGroupItem.displayName = ITEM_NAME$8;
|
|
13740
|
+
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
13741
|
+
ArrowLeft: "prev",
|
|
13742
|
+
ArrowUp: "prev",
|
|
13743
|
+
ArrowRight: "next",
|
|
13744
|
+
ArrowDown: "next",
|
|
13745
|
+
PageUp: "first",
|
|
13746
|
+
Home: "first",
|
|
13747
|
+
PageDown: "last",
|
|
13748
|
+
End: "last"
|
|
13749
|
+
};
|
|
13750
|
+
function getDirectionAwareKey(key, dir) {
|
|
13751
|
+
if (dir !== "rtl") return key;
|
|
13752
|
+
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
13753
|
+
}
|
|
13754
|
+
function getFocusIntent(event, orientation, dir) {
|
|
13755
|
+
const key = getDirectionAwareKey(event.key, dir);
|
|
13756
|
+
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
13757
|
+
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
13758
|
+
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
13759
|
+
}
|
|
13760
|
+
function focusFirst$3(candidates, preventScroll = false) {
|
|
13761
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
13762
|
+
for (const candidate of candidates) {
|
|
13763
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
13764
|
+
candidate.focus({ preventScroll });
|
|
13765
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
13766
|
+
}
|
|
13767
|
+
}
|
|
13768
|
+
function wrapArray$3(array2, startIndex) {
|
|
13769
|
+
return array2.map((_2, index2) => array2[(startIndex + index2) % array2.length]);
|
|
13770
|
+
}
|
|
13771
|
+
var Root$d = RovingFocusGroup;
|
|
13772
|
+
var Item$2 = RovingFocusGroupItem;
|
|
13773
|
+
var TABS_NAME = "Tabs";
|
|
13774
|
+
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
13775
|
+
createRovingFocusGroupScope
|
|
13776
|
+
]);
|
|
13777
|
+
var useRovingFocusGroupScope$4 = createRovingFocusGroupScope();
|
|
13778
|
+
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
13779
|
+
var Tabs$1 = React.forwardRef(
|
|
13780
|
+
(props2, forwardedRef) => {
|
|
13781
|
+
const {
|
|
13782
|
+
__scopeTabs,
|
|
13783
|
+
value: valueProp,
|
|
13784
|
+
onValueChange,
|
|
13785
|
+
defaultValue,
|
|
13786
|
+
orientation = "horizontal",
|
|
13787
|
+
dir,
|
|
13788
|
+
activationMode = "automatic",
|
|
13789
|
+
...tabsProps
|
|
13790
|
+
} = props2;
|
|
13791
|
+
const direction = useDirection(dir);
|
|
13792
|
+
const [value, setValue] = useControllableState$1({
|
|
13793
|
+
prop: valueProp,
|
|
13794
|
+
onChange: onValueChange,
|
|
13795
|
+
defaultProp: defaultValue ?? "",
|
|
13796
|
+
caller: TABS_NAME
|
|
13797
|
+
});
|
|
13798
|
+
return /* @__PURE__ */ jsx(
|
|
13799
|
+
TabsProvider,
|
|
13800
|
+
{
|
|
13801
|
+
scope: __scopeTabs,
|
|
13802
|
+
baseId: useId$1(),
|
|
13803
|
+
value,
|
|
13804
|
+
onValueChange: setValue,
|
|
13805
|
+
orientation,
|
|
13806
|
+
dir: direction,
|
|
13807
|
+
activationMode,
|
|
13808
|
+
children: /* @__PURE__ */ jsx(
|
|
13809
|
+
Primitive.div,
|
|
13810
|
+
{
|
|
13811
|
+
dir: direction,
|
|
13812
|
+
"data-orientation": orientation,
|
|
13813
|
+
...tabsProps,
|
|
13814
|
+
ref: forwardedRef
|
|
13815
|
+
}
|
|
13816
|
+
)
|
|
13817
|
+
}
|
|
13818
|
+
);
|
|
13819
|
+
}
|
|
13820
|
+
);
|
|
13821
|
+
Tabs$1.displayName = TABS_NAME;
|
|
13822
|
+
var TAB_LIST_NAME = "TabsList";
|
|
13823
|
+
var TabsList$1 = React.forwardRef(
|
|
13824
|
+
(props2, forwardedRef) => {
|
|
13825
|
+
const { __scopeTabs, loop = true, ...listProps } = props2;
|
|
13826
|
+
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
13827
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope$4(__scopeTabs);
|
|
13828
|
+
return /* @__PURE__ */ jsx(
|
|
13829
|
+
Root$d,
|
|
13830
|
+
{
|
|
13831
|
+
asChild: true,
|
|
13832
|
+
...rovingFocusGroupScope,
|
|
13833
|
+
orientation: context.orientation,
|
|
13834
|
+
dir: context.dir,
|
|
13835
|
+
loop,
|
|
13836
|
+
children: /* @__PURE__ */ jsx(
|
|
13837
|
+
Primitive.div,
|
|
13838
|
+
{
|
|
13839
|
+
role: "tablist",
|
|
13840
|
+
"aria-orientation": context.orientation,
|
|
13841
|
+
...listProps,
|
|
13842
|
+
ref: forwardedRef
|
|
13843
|
+
}
|
|
13844
|
+
)
|
|
13845
|
+
}
|
|
13846
|
+
);
|
|
13847
|
+
}
|
|
13848
|
+
);
|
|
13849
|
+
TabsList$1.displayName = TAB_LIST_NAME;
|
|
13850
|
+
var TRIGGER_NAME$a = "TabsTrigger";
|
|
13851
|
+
var TabsTrigger$1 = React.forwardRef(
|
|
13852
|
+
(props2, forwardedRef) => {
|
|
13853
|
+
const { __scopeTabs, value, disabled = false, ...triggerProps } = props2;
|
|
13854
|
+
const context = useTabsContext(TRIGGER_NAME$a, __scopeTabs);
|
|
13855
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope$4(__scopeTabs);
|
|
13856
|
+
const triggerId = makeTriggerId$1(context.baseId, value);
|
|
13857
|
+
const contentId = makeContentId$1(context.baseId, value);
|
|
13858
|
+
const isSelected = value === context.value;
|
|
13859
|
+
return /* @__PURE__ */ jsx(
|
|
13860
|
+
Item$2,
|
|
13861
|
+
{
|
|
13862
|
+
asChild: true,
|
|
13863
|
+
...rovingFocusGroupScope,
|
|
13864
|
+
focusable: !disabled,
|
|
13865
|
+
active: isSelected,
|
|
13866
|
+
children: /* @__PURE__ */ jsx(
|
|
13867
|
+
Primitive.button,
|
|
13868
|
+
{
|
|
13869
|
+
type: "button",
|
|
13870
|
+
role: "tab",
|
|
13871
|
+
"aria-selected": isSelected,
|
|
13872
|
+
"aria-controls": contentId,
|
|
13873
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
13874
|
+
"data-disabled": disabled ? "" : void 0,
|
|
13875
|
+
disabled,
|
|
13876
|
+
id: triggerId,
|
|
13877
|
+
...triggerProps,
|
|
13878
|
+
ref: forwardedRef,
|
|
13879
|
+
onMouseDown: composeEventHandlers$1(props2.onMouseDown, (event) => {
|
|
13880
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
13881
|
+
context.onValueChange(value);
|
|
13882
|
+
} else {
|
|
13883
|
+
event.preventDefault();
|
|
13884
|
+
}
|
|
13885
|
+
}),
|
|
13886
|
+
onKeyDown: composeEventHandlers$1(props2.onKeyDown, (event) => {
|
|
13887
|
+
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
13888
|
+
}),
|
|
13889
|
+
onFocus: composeEventHandlers$1(props2.onFocus, () => {
|
|
13890
|
+
const isAutomaticActivation = context.activationMode !== "manual";
|
|
13891
|
+
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
13892
|
+
context.onValueChange(value);
|
|
13893
|
+
}
|
|
13894
|
+
})
|
|
13895
|
+
}
|
|
13896
|
+
)
|
|
13897
|
+
}
|
|
13898
|
+
);
|
|
13899
|
+
}
|
|
13900
|
+
);
|
|
13901
|
+
TabsTrigger$1.displayName = TRIGGER_NAME$a;
|
|
13902
|
+
var CONTENT_NAME$c = "TabsContent";
|
|
13903
|
+
var TabsContent$1 = React.forwardRef(
|
|
13904
|
+
(props2, forwardedRef) => {
|
|
13905
|
+
const { __scopeTabs, value, forceMount, children, ...contentProps } = props2;
|
|
13906
|
+
const context = useTabsContext(CONTENT_NAME$c, __scopeTabs);
|
|
13907
|
+
const triggerId = makeTriggerId$1(context.baseId, value);
|
|
13908
|
+
const contentId = makeContentId$1(context.baseId, value);
|
|
13909
|
+
const isSelected = value === context.value;
|
|
13910
|
+
const isMountAnimationPreventedRef = React.useRef(isSelected);
|
|
13911
|
+
React.useEffect(() => {
|
|
13912
|
+
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
13913
|
+
return () => cancelAnimationFrame(rAF);
|
|
13914
|
+
}, []);
|
|
13915
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(
|
|
13916
|
+
Primitive.div,
|
|
13917
|
+
{
|
|
13918
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
13919
|
+
"data-orientation": context.orientation,
|
|
13920
|
+
role: "tabpanel",
|
|
13921
|
+
"aria-labelledby": triggerId,
|
|
13922
|
+
hidden: !present,
|
|
13923
|
+
id: contentId,
|
|
13924
|
+
tabIndex: 0,
|
|
13925
|
+
...contentProps,
|
|
13926
|
+
ref: forwardedRef,
|
|
13927
|
+
style: {
|
|
13928
|
+
...props2.style,
|
|
13929
|
+
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
13930
|
+
},
|
|
13931
|
+
children: present && children
|
|
13932
|
+
}
|
|
13933
|
+
) });
|
|
13934
|
+
}
|
|
13935
|
+
);
|
|
13936
|
+
TabsContent$1.displayName = CONTENT_NAME$c;
|
|
13937
|
+
function makeTriggerId$1(baseId, value) {
|
|
13938
|
+
return `${baseId}-trigger-${value}`;
|
|
13939
|
+
}
|
|
13940
|
+
function makeContentId$1(baseId, value) {
|
|
13941
|
+
return `${baseId}-content-${value}`;
|
|
13942
|
+
}
|
|
13943
|
+
var Root2$a = Tabs$1;
|
|
13944
|
+
var List$1 = TabsList$1;
|
|
13945
|
+
var Trigger$9 = TabsTrigger$1;
|
|
13946
|
+
var Content$4 = TabsContent$1;
|
|
13947
|
+
function Tabs({
|
|
13948
|
+
className,
|
|
13949
|
+
...props2
|
|
13950
|
+
}) {
|
|
13951
|
+
return /* @__PURE__ */ jsx(
|
|
13952
|
+
Root2$a,
|
|
13953
|
+
{
|
|
13954
|
+
"data-slot": "tabs",
|
|
13955
|
+
className: cn$1("flex flex-col gap-2", className),
|
|
13956
|
+
...props2
|
|
13957
|
+
}
|
|
13958
|
+
);
|
|
13959
|
+
}
|
|
13960
|
+
function TabsList({
|
|
13961
|
+
className,
|
|
13962
|
+
...props2
|
|
13963
|
+
}) {
|
|
13964
|
+
return /* @__PURE__ */ jsx(
|
|
13965
|
+
List$1,
|
|
13966
|
+
{
|
|
13967
|
+
"data-slot": "tabs-list",
|
|
13968
|
+
className: cn$1(
|
|
13969
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
13970
|
+
className
|
|
13971
|
+
),
|
|
13972
|
+
...props2
|
|
13973
|
+
}
|
|
13974
|
+
);
|
|
13975
|
+
}
|
|
13976
|
+
function TabsTrigger({
|
|
13977
|
+
className,
|
|
13978
|
+
...props2
|
|
13979
|
+
}) {
|
|
13980
|
+
return /* @__PURE__ */ jsx(
|
|
13981
|
+
Trigger$9,
|
|
13982
|
+
{
|
|
13983
|
+
"data-slot": "tabs-trigger",
|
|
13984
|
+
className: cn$1(
|
|
13985
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
13986
|
+
className
|
|
13987
|
+
),
|
|
13988
|
+
...props2
|
|
13989
|
+
}
|
|
13990
|
+
);
|
|
13991
|
+
}
|
|
13992
|
+
function TabsContent({
|
|
13993
|
+
className,
|
|
13994
|
+
...props2
|
|
13995
|
+
}) {
|
|
13996
|
+
return /* @__PURE__ */ jsx(
|
|
13997
|
+
Content$4,
|
|
13998
|
+
{
|
|
13999
|
+
"data-slot": "tabs-content",
|
|
14000
|
+
className: cn$1("flex-1 outline-none", className),
|
|
14001
|
+
...props2
|
|
14002
|
+
}
|
|
14003
|
+
);
|
|
14004
|
+
}
|
|
14005
|
+
const GRID_COLS = {
|
|
14006
|
+
base: {
|
|
14007
|
+
1: "grid-cols-1",
|
|
14008
|
+
2: "grid-cols-2",
|
|
14009
|
+
3: "grid-cols-3",
|
|
14010
|
+
4: "grid-cols-4",
|
|
14011
|
+
5: "grid-cols-5",
|
|
14012
|
+
6: "grid-cols-6",
|
|
14013
|
+
7: "grid-cols-7",
|
|
14014
|
+
8: "grid-cols-8",
|
|
14015
|
+
9: "grid-cols-9",
|
|
14016
|
+
10: "grid-cols-10",
|
|
14017
|
+
11: "grid-cols-11",
|
|
14018
|
+
12: "grid-cols-12"
|
|
14019
|
+
},
|
|
14020
|
+
sm: {
|
|
14021
|
+
1: "sm:grid-cols-1",
|
|
14022
|
+
2: "sm:grid-cols-2",
|
|
14023
|
+
3: "sm:grid-cols-3",
|
|
14024
|
+
4: "sm:grid-cols-4",
|
|
14025
|
+
5: "sm:grid-cols-5",
|
|
14026
|
+
6: "sm:grid-cols-6",
|
|
14027
|
+
7: "sm:grid-cols-7",
|
|
14028
|
+
8: "sm:grid-cols-8",
|
|
14029
|
+
9: "sm:grid-cols-9",
|
|
14030
|
+
10: "sm:grid-cols-10",
|
|
14031
|
+
11: "sm:grid-cols-11",
|
|
14032
|
+
12: "sm:grid-cols-12"
|
|
14033
|
+
},
|
|
14034
|
+
md: {
|
|
14035
|
+
1: "md:grid-cols-1",
|
|
14036
|
+
2: "md:grid-cols-2",
|
|
14037
|
+
3: "md:grid-cols-3",
|
|
14038
|
+
4: "md:grid-cols-4",
|
|
14039
|
+
5: "md:grid-cols-5",
|
|
14040
|
+
6: "md:grid-cols-6",
|
|
14041
|
+
7: "md:grid-cols-7",
|
|
14042
|
+
8: "md:grid-cols-8",
|
|
14043
|
+
9: "md:grid-cols-9",
|
|
14044
|
+
10: "md:grid-cols-10",
|
|
14045
|
+
11: "md:grid-cols-11",
|
|
14046
|
+
12: "md:grid-cols-12"
|
|
14047
|
+
},
|
|
14048
|
+
lg: {
|
|
14049
|
+
1: "lg:grid-cols-1",
|
|
14050
|
+
2: "lg:grid-cols-2",
|
|
14051
|
+
3: "lg:grid-cols-3",
|
|
14052
|
+
4: "lg:grid-cols-4",
|
|
14053
|
+
5: "lg:grid-cols-5",
|
|
14054
|
+
6: "lg:grid-cols-6",
|
|
14055
|
+
7: "lg:grid-cols-7",
|
|
14056
|
+
8: "lg:grid-cols-8",
|
|
14057
|
+
9: "lg:grid-cols-9",
|
|
14058
|
+
10: "lg:grid-cols-10",
|
|
14059
|
+
11: "lg:grid-cols-11",
|
|
14060
|
+
12: "lg:grid-cols-12"
|
|
14061
|
+
},
|
|
14062
|
+
xl: {
|
|
14063
|
+
1: "xl:grid-cols-1",
|
|
14064
|
+
2: "xl:grid-cols-2",
|
|
14065
|
+
3: "xl:grid-cols-3",
|
|
14066
|
+
4: "xl:grid-cols-4",
|
|
14067
|
+
5: "xl:grid-cols-5",
|
|
14068
|
+
6: "xl:grid-cols-6",
|
|
14069
|
+
7: "xl:grid-cols-7",
|
|
14070
|
+
8: "xl:grid-cols-8",
|
|
14071
|
+
9: "xl:grid-cols-9",
|
|
14072
|
+
10: "xl:grid-cols-10",
|
|
14073
|
+
11: "xl:grid-cols-11",
|
|
14074
|
+
12: "xl:grid-cols-12"
|
|
14075
|
+
}
|
|
14076
|
+
};
|
|
14077
|
+
const COL_SPAN = {
|
|
14078
|
+
base: {
|
|
14079
|
+
1: "col-span-1",
|
|
14080
|
+
2: "col-span-2",
|
|
14081
|
+
3: "col-span-3",
|
|
14082
|
+
4: "col-span-4",
|
|
14083
|
+
5: "col-span-5",
|
|
14084
|
+
6: "col-span-6",
|
|
14085
|
+
7: "col-span-7",
|
|
14086
|
+
8: "col-span-8",
|
|
14087
|
+
9: "col-span-9",
|
|
14088
|
+
10: "col-span-10",
|
|
14089
|
+
11: "col-span-11",
|
|
14090
|
+
12: "col-span-12"
|
|
14091
|
+
},
|
|
14092
|
+
sm: {
|
|
14093
|
+
1: "sm:col-span-1",
|
|
14094
|
+
2: "sm:col-span-2",
|
|
14095
|
+
3: "sm:col-span-3",
|
|
14096
|
+
4: "sm:col-span-4",
|
|
14097
|
+
5: "sm:col-span-5",
|
|
14098
|
+
6: "sm:col-span-6",
|
|
14099
|
+
7: "sm:col-span-7",
|
|
14100
|
+
8: "sm:col-span-8",
|
|
14101
|
+
9: "sm:col-span-9",
|
|
14102
|
+
10: "sm:col-span-10",
|
|
14103
|
+
11: "sm:col-span-11",
|
|
14104
|
+
12: "sm:col-span-12"
|
|
14105
|
+
},
|
|
14106
|
+
md: {
|
|
14107
|
+
1: "md:col-span-1",
|
|
14108
|
+
2: "md:col-span-2",
|
|
14109
|
+
3: "md:col-span-3",
|
|
14110
|
+
4: "md:col-span-4",
|
|
14111
|
+
5: "md:col-span-5",
|
|
14112
|
+
6: "md:col-span-6",
|
|
14113
|
+
7: "md:col-span-7",
|
|
14114
|
+
8: "md:col-span-8",
|
|
14115
|
+
9: "md:col-span-9",
|
|
14116
|
+
10: "md:col-span-10",
|
|
14117
|
+
11: "md:col-span-11",
|
|
14118
|
+
12: "md:col-span-12"
|
|
14119
|
+
},
|
|
14120
|
+
lg: {
|
|
14121
|
+
1: "lg:col-span-1",
|
|
14122
|
+
2: "lg:col-span-2",
|
|
14123
|
+
3: "lg:col-span-3",
|
|
14124
|
+
4: "lg:col-span-4",
|
|
14125
|
+
5: "lg:col-span-5",
|
|
14126
|
+
6: "lg:col-span-6",
|
|
14127
|
+
7: "lg:col-span-7",
|
|
14128
|
+
8: "lg:col-span-8",
|
|
14129
|
+
9: "lg:col-span-9",
|
|
14130
|
+
10: "lg:col-span-10",
|
|
14131
|
+
11: "lg:col-span-11",
|
|
14132
|
+
12: "lg:col-span-12"
|
|
14133
|
+
},
|
|
14134
|
+
xl: {
|
|
14135
|
+
1: "xl:col-span-1",
|
|
14136
|
+
2: "xl:col-span-2",
|
|
14137
|
+
3: "xl:col-span-3",
|
|
14138
|
+
4: "xl:col-span-4",
|
|
14139
|
+
5: "xl:col-span-5",
|
|
14140
|
+
6: "xl:col-span-6",
|
|
14141
|
+
7: "xl:col-span-7",
|
|
14142
|
+
8: "xl:col-span-8",
|
|
14143
|
+
9: "xl:col-span-9",
|
|
14144
|
+
10: "xl:col-span-10",
|
|
14145
|
+
11: "xl:col-span-11",
|
|
14146
|
+
12: "xl:col-span-12"
|
|
14147
|
+
}
|
|
14148
|
+
};
|
|
14149
|
+
function gridClasses(options) {
|
|
14150
|
+
const cols = (options == null ? void 0 : options.cols) ?? 1;
|
|
14151
|
+
const sm = options == null ? void 0 : options.smCols;
|
|
14152
|
+
const md = options == null ? void 0 : options.mdCols;
|
|
14153
|
+
const lg = options == null ? void 0 : options.lgCols;
|
|
14154
|
+
const xl = options == null ? void 0 : options.xlCols;
|
|
14155
|
+
const gap = (options == null ? void 0 : options.gap) ?? "gap-4";
|
|
14156
|
+
return cn$1(
|
|
14157
|
+
"grid",
|
|
14158
|
+
GRID_COLS.base[cols],
|
|
14159
|
+
sm ? GRID_COLS.sm[sm] : void 0,
|
|
14160
|
+
md ? GRID_COLS.md[md] : void 0,
|
|
14161
|
+
lg ? GRID_COLS.lg[lg] : void 0,
|
|
14162
|
+
xl ? GRID_COLS.xl[xl] : void 0,
|
|
14163
|
+
gap
|
|
14164
|
+
);
|
|
14165
|
+
}
|
|
14166
|
+
function flexClasses(options) {
|
|
14167
|
+
const direction = (options == null ? void 0 : options.direction) ?? "col";
|
|
14168
|
+
const wrap = (options == null ? void 0 : options.wrap) ? "flex-wrap" : "flex-nowrap";
|
|
14169
|
+
const gap = (options == null ? void 0 : options.gap) ?? "gap-4";
|
|
14170
|
+
const align = (options == null ? void 0 : options.align) ?? "stretch";
|
|
14171
|
+
const justify = (options == null ? void 0 : options.justify) ?? "start";
|
|
14172
|
+
const alignClass = align === "start" ? "items-start" : align === "center" ? "items-center" : align === "end" ? "items-end" : "items-stretch";
|
|
14173
|
+
const justifyClass = justify === "start" ? "justify-start" : justify === "center" ? "justify-center" : justify === "between" ? "justify-between" : "justify-end";
|
|
14174
|
+
return cn$1("flex", `flex-${direction}`, wrap, gap, alignClass, justifyClass);
|
|
14175
|
+
}
|
|
14176
|
+
function leafSpanClasses(leaf) {
|
|
14177
|
+
if (!leaf.span) return void 0;
|
|
14178
|
+
const parts = [];
|
|
14179
|
+
if (leaf.span.base) parts.push(COL_SPAN.base[leaf.span.base]);
|
|
14180
|
+
if (leaf.span.sm) parts.push(COL_SPAN.sm[leaf.span.sm]);
|
|
14181
|
+
if (leaf.span.md) parts.push(COL_SPAN.md[leaf.span.md]);
|
|
14182
|
+
if (leaf.span.lg) parts.push(COL_SPAN.lg[leaf.span.lg]);
|
|
14183
|
+
if (leaf.span.xl) parts.push(COL_SPAN.xl[leaf.span.xl]);
|
|
14184
|
+
return parts.join(" ");
|
|
14185
|
+
}
|
|
14186
|
+
function isLeaf(child) {
|
|
14187
|
+
return child.content !== void 0;
|
|
14188
|
+
}
|
|
14189
|
+
function shallowEqualSpan(a2, b2) {
|
|
14190
|
+
if (a2 === b2) return true;
|
|
14191
|
+
if (!a2 || !b2) return !a2 && !b2;
|
|
14192
|
+
return a2.base === b2.base && a2.sm === b2.sm && a2.md === b2.md && a2.lg === b2.lg && a2.xl === b2.xl;
|
|
14193
|
+
}
|
|
14194
|
+
function shallowEqualLeaf(a2, b2) {
|
|
14195
|
+
const renderKeyEqual = (a2.renderKey ?? null) === (b2.renderKey ?? null);
|
|
14196
|
+
return a2.key === b2.key && a2.hidden === b2.hidden && a2.className === b2.className && a2.labelLayout === b2.labelLayout && a2.labelClassName === b2.labelClassName && a2.valueClassName === b2.valueClassName && a2.inlineLabelWidthClass === b2.inlineLabelWidthClass && shallowEqualSpan(a2.span, b2.span) && renderKeyEqual;
|
|
14197
|
+
}
|
|
14198
|
+
const SectionLeafRenderer = memo$1(
|
|
14199
|
+
function SectionLeafRenderer2({ leaf, renderLeaf }) {
|
|
14200
|
+
if (leaf.hidden) return null;
|
|
14201
|
+
const span = leafSpanClasses(leaf);
|
|
14202
|
+
if (renderLeaf) {
|
|
14203
|
+
return /* @__PURE__ */ jsx("div", { className: cn$1(span, leaf.className), children: renderLeaf(leaf) });
|
|
14204
|
+
}
|
|
14205
|
+
const hasLabel = leaf.label !== void 0 && leaf.label !== null && leaf.label !== "";
|
|
14206
|
+
const layout = leaf.labelLayout ?? "stacked";
|
|
14207
|
+
const labelBaseCls = "text-xs text-muted-foreground";
|
|
14208
|
+
const valueBaseCls = "text-sm leading-6";
|
|
14209
|
+
if (!hasLabel) {
|
|
14210
|
+
return /* @__PURE__ */ jsx("div", { className: cn$1(span, leaf.className, leaf.valueClassName), children: leaf.content });
|
|
14211
|
+
}
|
|
14212
|
+
if (layout === "inline") {
|
|
14213
|
+
const labelWidth = leaf.inlineLabelWidthClass ?? "w-32";
|
|
14214
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1(span, leaf.className, "flex items-start gap-4"), children: [
|
|
14215
|
+
/* @__PURE__ */ jsx("div", { className: cn$1(labelWidth, labelBaseCls, leaf.labelClassName), children: leaf.label }),
|
|
14216
|
+
/* @__PURE__ */ jsxs("div", { className: cn$1("flex-1", valueBaseCls, leaf.valueClassName), children: [
|
|
14217
|
+
leaf.content,
|
|
14218
|
+
leaf.description ? /* @__PURE__ */ jsx("div", { className: cn$1("mt-1", labelBaseCls), children: leaf.description }) : null
|
|
14219
|
+
] })
|
|
14220
|
+
] });
|
|
14221
|
+
}
|
|
14222
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1(span, leaf.className, "flex flex-col"), children: [
|
|
14223
|
+
/* @__PURE__ */ jsx("div", { className: cn$1(labelBaseCls, leaf.labelClassName), children: leaf.label }),
|
|
14224
|
+
/* @__PURE__ */ jsx("div", { className: cn$1(valueBaseCls, leaf.valueClassName), children: leaf.content }),
|
|
14225
|
+
leaf.description ? /* @__PURE__ */ jsx("div", { className: cn$1("mt-1", labelBaseCls), children: leaf.description }) : null
|
|
14226
|
+
] });
|
|
14227
|
+
},
|
|
14228
|
+
(prev, next) => shallowEqualLeaf(prev.leaf, next.leaf) && prev.renderLeaf === next.renderLeaf
|
|
14229
|
+
);
|
|
14230
|
+
function SectionNodeRenderer({ node, renderLeaf }) {
|
|
14231
|
+
var _a;
|
|
14232
|
+
if (node.hidden) return null;
|
|
14233
|
+
const layout = node.layout ?? "grid";
|
|
14234
|
+
const containerClass = layout === "grid" ? gridClasses(node.grid) : layout === "flex" ? flexClasses(node.flex) : "";
|
|
14235
|
+
const SectionContainer = ({ children }) => {
|
|
14236
|
+
const title = node.title;
|
|
14237
|
+
const description = node.subtitle;
|
|
14238
|
+
const variant = node.variant ?? "card";
|
|
14239
|
+
const className = node.className;
|
|
14240
|
+
const headerClassName = node.headerClassName;
|
|
14241
|
+
const contentClassName = node.contentClassName;
|
|
14242
|
+
const renderHeader = () => {
|
|
14243
|
+
if (!title && !description) return null;
|
|
14244
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-1", headerClassName), children: [
|
|
14245
|
+
title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium leading-none", children: title }),
|
|
14246
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
|
|
14247
|
+
] });
|
|
14248
|
+
};
|
|
14249
|
+
const renderContent2 = () => /* @__PURE__ */ jsx("div", { className: cn$1("space-y-4", contentClassName), children });
|
|
14250
|
+
switch (variant) {
|
|
14251
|
+
case "card":
|
|
14252
|
+
return /* @__PURE__ */ jsxs(Card, { className, children: [
|
|
14253
|
+
(title || description) && /* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
14254
|
+
title && /* @__PURE__ */ jsx(CardTitle, { children: title }),
|
|
14255
|
+
description && /* @__PURE__ */ jsx(CardDescription, { children: description })
|
|
14256
|
+
] }),
|
|
14257
|
+
/* @__PURE__ */ jsx(CardContent, { children: renderContent2() })
|
|
14258
|
+
] });
|
|
14259
|
+
case "separator":
|
|
14260
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-6", className), children: [
|
|
14261
|
+
(title || description) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14262
|
+
renderHeader(),
|
|
14263
|
+
/* @__PURE__ */ jsx(Separator$2, {})
|
|
14264
|
+
] }),
|
|
14265
|
+
renderContent2()
|
|
14266
|
+
] });
|
|
14267
|
+
default:
|
|
14268
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-6", className), children: [
|
|
14269
|
+
renderHeader(),
|
|
14270
|
+
renderContent2()
|
|
14271
|
+
] });
|
|
14272
|
+
}
|
|
14273
|
+
};
|
|
14274
|
+
if (layout === "tabs" && node.tabs && node.tabs.length > 0) {
|
|
14275
|
+
const defaultTabId = node.defaultTabId ?? ((_a = node.tabs[0]) == null ? void 0 : _a.id);
|
|
14276
|
+
return /* @__PURE__ */ jsx(SectionContainer, { children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: defaultTabId, className: cn$1("space-y-2"), children: [
|
|
14277
|
+
/* @__PURE__ */ jsx(TabsList, { className: cn$1(node.tabsListClassName), children: node.tabs.map((tab) => /* @__PURE__ */ jsx(TabsTrigger, { value: tab.id, className: cn$1(tab.className), children: tab.label }, tab.id)) }),
|
|
14278
|
+
node.tabs.map((tab) => /* @__PURE__ */ jsx(TabsContent, { value: tab.id, className: cn$1(node.tabsContentClassName, tab.contentClassName), children: /* @__PURE__ */ jsx(SectionNodeRenderer, { node: tab.node, renderLeaf }) }, tab.id))
|
|
14279
|
+
] }) });
|
|
14280
|
+
}
|
|
14281
|
+
return /* @__PURE__ */ jsx(SectionContainer, { children: /* @__PURE__ */ jsx("div", { className: containerClass, children: (node.children ?? []).map((child) => {
|
|
14282
|
+
if (isLeaf(child)) {
|
|
14283
|
+
return /* @__PURE__ */ jsx(SectionLeafRenderer, { leaf: child, renderLeaf }, child.key);
|
|
14284
|
+
}
|
|
14285
|
+
if (child.hidden) return null;
|
|
14286
|
+
return /* @__PURE__ */ jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsx(SectionNodeRenderer, { node: child, renderLeaf }) }, child.id);
|
|
14287
|
+
}) }) });
|
|
14288
|
+
}
|
|
14289
|
+
function SectionBuilder({ sections, className, renderLeaf }) {
|
|
14290
|
+
return /* @__PURE__ */ jsx("div", { className: cn$1("space-y-6", className), children: sections.map((section) => /* @__PURE__ */ jsx(SectionNodeRenderer, { node: section, renderLeaf }, section.id)) });
|
|
14291
|
+
}
|
|
14292
|
+
var NAME$4 = "Label";
|
|
13433
14293
|
var Label$3 = React.forwardRef((props2, forwardedRef) => {
|
|
13434
14294
|
return /* @__PURE__ */ jsx(
|
|
13435
14295
|
Primitive.label,
|
|
@@ -13446,14 +14306,14 @@ var Label$3 = React.forwardRef((props2, forwardedRef) => {
|
|
|
13446
14306
|
}
|
|
13447
14307
|
);
|
|
13448
14308
|
});
|
|
13449
|
-
Label$3.displayName = NAME$
|
|
13450
|
-
var Root$
|
|
14309
|
+
Label$3.displayName = NAME$4;
|
|
14310
|
+
var Root$c = Label$3;
|
|
13451
14311
|
function Label$2({
|
|
13452
14312
|
className,
|
|
13453
14313
|
...props2
|
|
13454
14314
|
}) {
|
|
13455
14315
|
return /* @__PURE__ */ jsx(
|
|
13456
|
-
Root$
|
|
14316
|
+
Root$c,
|
|
13457
14317
|
{
|
|
13458
14318
|
"data-slot": "label",
|
|
13459
14319
|
className: cn$1(
|
|
@@ -13464,16 +14324,6 @@ function Label$2({
|
|
|
13464
14324
|
}
|
|
13465
14325
|
);
|
|
13466
14326
|
}
|
|
13467
|
-
function useCallbackRef$2(callback) {
|
|
13468
|
-
const callbackRef = React.useRef(callback);
|
|
13469
|
-
React.useEffect(() => {
|
|
13470
|
-
callbackRef.current = callback;
|
|
13471
|
-
});
|
|
13472
|
-
return React.useMemo(() => (...args) => {
|
|
13473
|
-
var _a;
|
|
13474
|
-
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
13475
|
-
}, []);
|
|
13476
|
-
}
|
|
13477
14327
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
13478
14328
|
const onEscapeKeyDown = useCallbackRef$2(onEscapeKeyDownProp);
|
|
13479
14329
|
React.useEffect(() => {
|
|
@@ -13714,7 +14564,7 @@ function createFocusGuard() {
|
|
|
13714
14564
|
}
|
|
13715
14565
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
13716
14566
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
13717
|
-
var EVENT_OPTIONS
|
|
14567
|
+
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
13718
14568
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
13719
14569
|
var FocusScope = React.forwardRef((props2, forwardedRef) => {
|
|
13720
14570
|
const {
|
|
@@ -13779,11 +14629,11 @@ var FocusScope = React.forwardRef((props2, forwardedRef) => {
|
|
|
13779
14629
|
const previouslyFocusedElement = document.activeElement;
|
|
13780
14630
|
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
13781
14631
|
if (!hasFocusedCandidate) {
|
|
13782
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS
|
|
14632
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
13783
14633
|
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
13784
14634
|
container.dispatchEvent(mountEvent);
|
|
13785
14635
|
if (!mountEvent.defaultPrevented) {
|
|
13786
|
-
focusFirst$
|
|
14636
|
+
focusFirst$2(removeLinks(getTabbableCandidates$1(container)), { select: true });
|
|
13787
14637
|
if (document.activeElement === previouslyFocusedElement) {
|
|
13788
14638
|
focus(container);
|
|
13789
14639
|
}
|
|
@@ -13792,7 +14642,7 @@ var FocusScope = React.forwardRef((props2, forwardedRef) => {
|
|
|
13792
14642
|
return () => {
|
|
13793
14643
|
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
13794
14644
|
setTimeout(() => {
|
|
13795
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS
|
|
14645
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
13796
14646
|
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
13797
14647
|
container.dispatchEvent(unmountEvent);
|
|
13798
14648
|
if (!unmountEvent.defaultPrevented) {
|
|
@@ -13832,7 +14682,7 @@ var FocusScope = React.forwardRef((props2, forwardedRef) => {
|
|
|
13832
14682
|
return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
13833
14683
|
});
|
|
13834
14684
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
13835
|
-
function focusFirst$
|
|
14685
|
+
function focusFirst$2(candidates, { select = false } = {}) {
|
|
13836
14686
|
const previouslyFocusedElement = document.activeElement;
|
|
13837
14687
|
for (const candidate of candidates) {
|
|
13838
14688
|
focus(candidate, { select });
|
|
@@ -15781,7 +16631,7 @@ const arrow = (options, deps) => ({
|
|
|
15781
16631
|
...arrow$1(options),
|
|
15782
16632
|
options: [options, deps]
|
|
15783
16633
|
});
|
|
15784
|
-
var NAME$
|
|
16634
|
+
var NAME$3 = "Arrow";
|
|
15785
16635
|
var Arrow$1 = React.forwardRef((props2, forwardedRef) => {
|
|
15786
16636
|
const { children, width = 10, height = 5, ...arrowProps } = props2;
|
|
15787
16637
|
return /* @__PURE__ */ jsx(
|
|
@@ -15797,8 +16647,8 @@ var Arrow$1 = React.forwardRef((props2, forwardedRef) => {
|
|
|
15797
16647
|
}
|
|
15798
16648
|
);
|
|
15799
16649
|
});
|
|
15800
|
-
Arrow$1.displayName = NAME$
|
|
15801
|
-
var Root$
|
|
16650
|
+
Arrow$1.displayName = NAME$3;
|
|
16651
|
+
var Root$b = Arrow$1;
|
|
15802
16652
|
var POPPER_NAME = "Popper";
|
|
15803
16653
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
15804
16654
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
@@ -15827,8 +16677,8 @@ var PopperAnchor = React.forwardRef(
|
|
|
15827
16677
|
}
|
|
15828
16678
|
);
|
|
15829
16679
|
PopperAnchor.displayName = ANCHOR_NAME$2;
|
|
15830
|
-
var CONTENT_NAME$
|
|
15831
|
-
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$
|
|
16680
|
+
var CONTENT_NAME$b = "PopperContent";
|
|
16681
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$b);
|
|
15832
16682
|
var PopperContent = React.forwardRef(
|
|
15833
16683
|
(props2, forwardedRef) => {
|
|
15834
16684
|
var _a, _b, _c, _d, _e2, _f;
|
|
@@ -15848,7 +16698,7 @@ var PopperContent = React.forwardRef(
|
|
|
15848
16698
|
onPlaced,
|
|
15849
16699
|
...contentProps
|
|
15850
16700
|
} = props2;
|
|
15851
|
-
const context = usePopperContext(CONTENT_NAME$
|
|
16701
|
+
const context = usePopperContext(CONTENT_NAME$b, __scopePopper);
|
|
15852
16702
|
const [content, setContent] = React.useState(null);
|
|
15853
16703
|
const composedRefs = useComposedRefs$1(forwardedRef, (node) => setContent(node));
|
|
15854
16704
|
const [arrow$12, setArrow] = React.useState(null);
|
|
@@ -15971,7 +16821,7 @@ var PopperContent = React.forwardRef(
|
|
|
15971
16821
|
);
|
|
15972
16822
|
}
|
|
15973
16823
|
);
|
|
15974
|
-
PopperContent.displayName = CONTENT_NAME$
|
|
16824
|
+
PopperContent.displayName = CONTENT_NAME$b;
|
|
15975
16825
|
var ARROW_NAME$8 = "PopperArrow";
|
|
15976
16826
|
var OPPOSITE_SIDE = {
|
|
15977
16827
|
top: "bottom",
|
|
@@ -16011,7 +16861,7 @@ var PopperArrow = React.forwardRef(function PopperArrow2(props2, forwardedRef) {
|
|
|
16011
16861
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
16012
16862
|
},
|
|
16013
16863
|
children: /* @__PURE__ */ jsx(
|
|
16014
|
-
Root$
|
|
16864
|
+
Root$b,
|
|
16015
16865
|
{
|
|
16016
16866
|
...arrowProps,
|
|
16017
16867
|
ref: forwardedRef,
|
|
@@ -16066,9 +16916,9 @@ function getSideAndAlignFromPlacement(placement) {
|
|
|
16066
16916
|
const [side, align = "center"] = placement.split("-");
|
|
16067
16917
|
return [side, align];
|
|
16068
16918
|
}
|
|
16069
|
-
var Root2$
|
|
16919
|
+
var Root2$9 = Popper;
|
|
16070
16920
|
var Anchor = PopperAnchor;
|
|
16071
|
-
var Content$
|
|
16921
|
+
var Content$3 = PopperContent;
|
|
16072
16922
|
var Arrow = PopperArrow;
|
|
16073
16923
|
var PORTAL_NAME$a = "Portal";
|
|
16074
16924
|
var Portal$7 = React.forwardRef((props2, forwardedRef) => {
|
|
@@ -16904,7 +17754,7 @@ var Popover$1 = (props2) => {
|
|
|
16904
17754
|
onChange: onOpenChange,
|
|
16905
17755
|
caller: POPOVER_NAME
|
|
16906
17756
|
});
|
|
16907
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
17757
|
+
return /* @__PURE__ */ jsx(Root2$9, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
16908
17758
|
PopoverProvider,
|
|
16909
17759
|
{
|
|
16910
17760
|
scope: __scopePopover,
|
|
@@ -16937,11 +17787,11 @@ var PopoverAnchor$1 = React.forwardRef(
|
|
|
16937
17787
|
}
|
|
16938
17788
|
);
|
|
16939
17789
|
PopoverAnchor$1.displayName = ANCHOR_NAME$1;
|
|
16940
|
-
var TRIGGER_NAME$
|
|
17790
|
+
var TRIGGER_NAME$9 = "PopoverTrigger";
|
|
16941
17791
|
var PopoverTrigger$1 = React.forwardRef(
|
|
16942
17792
|
(props2, forwardedRef) => {
|
|
16943
17793
|
const { __scopePopover, ...triggerProps } = props2;
|
|
16944
|
-
const context = usePopoverContext(TRIGGER_NAME$
|
|
17794
|
+
const context = usePopoverContext(TRIGGER_NAME$9, __scopePopover);
|
|
16945
17795
|
const popperScope = usePopperScope$4(__scopePopover);
|
|
16946
17796
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
16947
17797
|
const trigger = /* @__PURE__ */ jsx(
|
|
@@ -16960,7 +17810,7 @@ var PopoverTrigger$1 = React.forwardRef(
|
|
|
16960
17810
|
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
16961
17811
|
}
|
|
16962
17812
|
);
|
|
16963
|
-
PopoverTrigger$1.displayName = TRIGGER_NAME$
|
|
17813
|
+
PopoverTrigger$1.displayName = TRIGGER_NAME$9;
|
|
16964
17814
|
var PORTAL_NAME$9 = "PopoverPortal";
|
|
16965
17815
|
var [PortalProvider$4, usePortalContext$4] = createPopoverContext(PORTAL_NAME$9, {
|
|
16966
17816
|
forceMount: void 0
|
|
@@ -16971,20 +17821,20 @@ var PopoverPortal = (props2) => {
|
|
|
16971
17821
|
return /* @__PURE__ */ jsx(PortalProvider$4, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$7, { asChild: true, container, children }) }) });
|
|
16972
17822
|
};
|
|
16973
17823
|
PopoverPortal.displayName = PORTAL_NAME$9;
|
|
16974
|
-
var CONTENT_NAME$
|
|
17824
|
+
var CONTENT_NAME$a = "PopoverContent";
|
|
16975
17825
|
var PopoverContent$1 = React.forwardRef(
|
|
16976
17826
|
(props2, forwardedRef) => {
|
|
16977
|
-
const portalContext = usePortalContext$4(CONTENT_NAME$
|
|
17827
|
+
const portalContext = usePortalContext$4(CONTENT_NAME$a, props2.__scopePopover);
|
|
16978
17828
|
const { forceMount = portalContext.forceMount, ...contentProps } = props2;
|
|
16979
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
17829
|
+
const context = usePopoverContext(CONTENT_NAME$a, props2.__scopePopover);
|
|
16980
17830
|
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
16981
17831
|
}
|
|
16982
17832
|
);
|
|
16983
|
-
PopoverContent$1.displayName = CONTENT_NAME$
|
|
17833
|
+
PopoverContent$1.displayName = CONTENT_NAME$a;
|
|
16984
17834
|
var Slot$3 = /* @__PURE__ */ createSlot("PopoverContent.RemoveScroll");
|
|
16985
17835
|
var PopoverContentModal = React.forwardRef(
|
|
16986
17836
|
(props2, forwardedRef) => {
|
|
16987
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
17837
|
+
const context = usePopoverContext(CONTENT_NAME$a, props2.__scopePopover);
|
|
16988
17838
|
const contentRef = React.useRef(null);
|
|
16989
17839
|
const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
|
|
16990
17840
|
const isRightClickOutsideRef = React.useRef(false);
|
|
@@ -17025,7 +17875,7 @@ var PopoverContentModal = React.forwardRef(
|
|
|
17025
17875
|
);
|
|
17026
17876
|
var PopoverContentNonModal = React.forwardRef(
|
|
17027
17877
|
(props2, forwardedRef) => {
|
|
17028
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
17878
|
+
const context = usePopoverContext(CONTENT_NAME$a, props2.__scopePopover);
|
|
17029
17879
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
17030
17880
|
const hasPointerDownOutsideRef = React.useRef(false);
|
|
17031
17881
|
return /* @__PURE__ */ jsx(
|
|
@@ -17079,7 +17929,7 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
17079
17929
|
onInteractOutside,
|
|
17080
17930
|
...contentProps
|
|
17081
17931
|
} = props2;
|
|
17082
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
17932
|
+
const context = usePopoverContext(CONTENT_NAME$a, __scopePopover);
|
|
17083
17933
|
const popperScope = usePopperScope$4(__scopePopover);
|
|
17084
17934
|
useFocusGuards();
|
|
17085
17935
|
return /* @__PURE__ */ jsx(
|
|
@@ -17101,7 +17951,7 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
17101
17951
|
onFocusOutside,
|
|
17102
17952
|
onDismiss: () => context.onOpenChange(false),
|
|
17103
17953
|
children: /* @__PURE__ */ jsx(
|
|
17104
|
-
Content$
|
|
17954
|
+
Content$3,
|
|
17105
17955
|
{
|
|
17106
17956
|
"data-state": getState$3(context.open),
|
|
17107
17957
|
role: "dialog",
|
|
@@ -17157,20 +18007,20 @@ PopoverArrow.displayName = ARROW_NAME$7;
|
|
|
17157
18007
|
function getState$3(open) {
|
|
17158
18008
|
return open ? "open" : "closed";
|
|
17159
18009
|
}
|
|
17160
|
-
var Root2$
|
|
18010
|
+
var Root2$8 = Popover$1;
|
|
17161
18011
|
var Anchor2$1 = PopoverAnchor$1;
|
|
17162
|
-
var Trigger$
|
|
18012
|
+
var Trigger$8 = PopoverTrigger$1;
|
|
17163
18013
|
var Portal$6 = PopoverPortal;
|
|
17164
18014
|
var Content2$8 = PopoverContent$1;
|
|
17165
18015
|
function Popover({
|
|
17166
18016
|
...props2
|
|
17167
18017
|
}) {
|
|
17168
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
18018
|
+
return /* @__PURE__ */ jsx(Root2$8, { "data-slot": "popover", ...props2 });
|
|
17169
18019
|
}
|
|
17170
18020
|
function PopoverTrigger({
|
|
17171
18021
|
...props2
|
|
17172
18022
|
}) {
|
|
17173
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
18023
|
+
return /* @__PURE__ */ jsx(Trigger$8, { "data-slot": "popover-trigger", ...props2 });
|
|
17174
18024
|
}
|
|
17175
18025
|
function PopoverContent({
|
|
17176
18026
|
className,
|
|
@@ -17185,7 +18035,7 @@ function PopoverContent({
|
|
|
17185
18035
|
align,
|
|
17186
18036
|
sideOffset,
|
|
17187
18037
|
className: cn$1(
|
|
17188
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
18038
|
+
"border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
17189
18039
|
className
|
|
17190
18040
|
),
|
|
17191
18041
|
...props2
|
|
@@ -17250,11 +18100,11 @@ var Dialog$1 = (props2) => {
|
|
|
17250
18100
|
);
|
|
17251
18101
|
};
|
|
17252
18102
|
Dialog$1.displayName = DIALOG_NAME;
|
|
17253
|
-
var TRIGGER_NAME$
|
|
18103
|
+
var TRIGGER_NAME$8 = "DialogTrigger";
|
|
17254
18104
|
var DialogTrigger$1 = React.forwardRef(
|
|
17255
18105
|
(props2, forwardedRef) => {
|
|
17256
18106
|
const { __scopeDialog, ...triggerProps } = props2;
|
|
17257
|
-
const context = useDialogContext(TRIGGER_NAME$
|
|
18107
|
+
const context = useDialogContext(TRIGGER_NAME$8, __scopeDialog);
|
|
17258
18108
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
17259
18109
|
return /* @__PURE__ */ jsx(
|
|
17260
18110
|
Primitive.button,
|
|
@@ -17271,7 +18121,7 @@ var DialogTrigger$1 = React.forwardRef(
|
|
|
17271
18121
|
);
|
|
17272
18122
|
}
|
|
17273
18123
|
);
|
|
17274
|
-
DialogTrigger$1.displayName = TRIGGER_NAME$
|
|
18124
|
+
DialogTrigger$1.displayName = TRIGGER_NAME$8;
|
|
17275
18125
|
var PORTAL_NAME$8 = "DialogPortal";
|
|
17276
18126
|
var [PortalProvider$3, usePortalContext$3] = createDialogContext(PORTAL_NAME$8, {
|
|
17277
18127
|
forceMount: void 0
|
|
@@ -17312,19 +18162,19 @@ var DialogOverlayImpl = React.forwardRef(
|
|
|
17312
18162
|
);
|
|
17313
18163
|
}
|
|
17314
18164
|
);
|
|
17315
|
-
var CONTENT_NAME$
|
|
18165
|
+
var CONTENT_NAME$9 = "DialogContent";
|
|
17316
18166
|
var DialogContent$1 = React.forwardRef(
|
|
17317
18167
|
(props2, forwardedRef) => {
|
|
17318
|
-
const portalContext = usePortalContext$3(CONTENT_NAME$
|
|
18168
|
+
const portalContext = usePortalContext$3(CONTENT_NAME$9, props2.__scopeDialog);
|
|
17319
18169
|
const { forceMount = portalContext.forceMount, ...contentProps } = props2;
|
|
17320
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
18170
|
+
const context = useDialogContext(CONTENT_NAME$9, props2.__scopeDialog);
|
|
17321
18171
|
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
17322
18172
|
}
|
|
17323
18173
|
);
|
|
17324
|
-
DialogContent$1.displayName = CONTENT_NAME$
|
|
18174
|
+
DialogContent$1.displayName = CONTENT_NAME$9;
|
|
17325
18175
|
var DialogContentModal = React.forwardRef(
|
|
17326
18176
|
(props2, forwardedRef) => {
|
|
17327
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
18177
|
+
const context = useDialogContext(CONTENT_NAME$9, props2.__scopeDialog);
|
|
17328
18178
|
const contentRef = React.useRef(null);
|
|
17329
18179
|
const composedRefs = useComposedRefs$1(forwardedRef, context.contentRef, contentRef);
|
|
17330
18180
|
React.useEffect(() => {
|
|
@@ -17359,7 +18209,7 @@ var DialogContentModal = React.forwardRef(
|
|
|
17359
18209
|
);
|
|
17360
18210
|
var DialogContentNonModal = React.forwardRef(
|
|
17361
18211
|
(props2, forwardedRef) => {
|
|
17362
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
18212
|
+
const context = useDialogContext(CONTENT_NAME$9, props2.__scopeDialog);
|
|
17363
18213
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
17364
18214
|
const hasPointerDownOutsideRef = React.useRef(false);
|
|
17365
18215
|
return /* @__PURE__ */ jsx(
|
|
@@ -17402,7 +18252,7 @@ var DialogContentNonModal = React.forwardRef(
|
|
|
17402
18252
|
var DialogContentImpl = React.forwardRef(
|
|
17403
18253
|
(props2, forwardedRef) => {
|
|
17404
18254
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props2;
|
|
17405
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
18255
|
+
const context = useDialogContext(CONTENT_NAME$9, __scopeDialog);
|
|
17406
18256
|
const contentRef = React.useRef(null);
|
|
17407
18257
|
const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
|
|
17408
18258
|
useFocusGuards();
|
|
@@ -17477,7 +18327,7 @@ function getState$2(open) {
|
|
|
17477
18327
|
}
|
|
17478
18328
|
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
17479
18329
|
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
17480
|
-
contentName: CONTENT_NAME$
|
|
18330
|
+
contentName: CONTENT_NAME$9,
|
|
17481
18331
|
titleName: TITLE_NAME$1,
|
|
17482
18332
|
docsSlug: "dialog"
|
|
17483
18333
|
});
|
|
@@ -17510,11 +18360,11 @@ var DescriptionWarning$1 = ({ contentRef, descriptionId }) => {
|
|
|
17510
18360
|
}, [MESSAGE, contentRef, descriptionId]);
|
|
17511
18361
|
return null;
|
|
17512
18362
|
};
|
|
17513
|
-
var Root$
|
|
17514
|
-
var Trigger$
|
|
18363
|
+
var Root$a = Dialog$1;
|
|
18364
|
+
var Trigger$7 = DialogTrigger$1;
|
|
17515
18365
|
var Portal$5 = DialogPortal$1;
|
|
17516
18366
|
var Overlay$1 = DialogOverlay$1;
|
|
17517
|
-
var Content$
|
|
18367
|
+
var Content$2 = DialogContent$1;
|
|
17518
18368
|
var Title = DialogTitle$1;
|
|
17519
18369
|
var Description = DialogDescription$1;
|
|
17520
18370
|
var Close = DialogClose$1;
|
|
@@ -17746,7 +18596,7 @@ var N$1 = '[cmdk-group=""]', Y$1 = '[cmdk-group-items=""]', be = '[cmdk-group-he
|
|
|
17746
18596
|
}, []), React.createElement(Primitive.div, { ref: composeRefs$1(d, o2), ...c2, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b2.listId }, B(r2, (m2) => React.createElement("div", { ref: composeRefs$1(f, b2.listInnerRef), "cmdk-list-sizer": "" }, m2)));
|
|
17747
18597
|
}), xe = React.forwardRef((r2, o2) => {
|
|
17748
18598
|
let { open: n2, onOpenChange: u2, overlayClassName: c2, contentClassName: d, container: f, ...p2 } = r2;
|
|
17749
|
-
return React.createElement(Root$
|
|
18599
|
+
return React.createElement(Root$a, { open: n2, onOpenChange: u2 }, React.createElement(Portal$5, { container: f }, React.createElement(Overlay$1, { "cmdk-overlay": "", className: c2 }), React.createElement(Content$2, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, React.createElement(me, { ref: o2, ...p2 }))));
|
|
17750
18600
|
}), Ie = React.forwardRef((r2, o2) => P((u2) => u2.filtered.count === 0) ? React.createElement(Primitive.div, { ref: o2, ...r2, "cmdk-empty": "", role: "presentation" }) : null), Pe = React.forwardRef((r2, o2) => {
|
|
17751
18601
|
let { progress: n2, children: u2, label: c2 = "Loading...", ...d } = r2;
|
|
17752
18602
|
return React.createElement(Primitive.div, { ref: o2, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n2, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c2 }, B(r2, (f) => React.createElement("div", { "aria-hidden": true }, f)));
|
|
@@ -17813,12 +18663,12 @@ var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", marg
|
|
|
17813
18663
|
function Dialog({
|
|
17814
18664
|
...props2
|
|
17815
18665
|
}) {
|
|
17816
|
-
return /* @__PURE__ */ jsx(Root$
|
|
18666
|
+
return /* @__PURE__ */ jsx(Root$a, { "data-slot": "dialog", ...props2 });
|
|
17817
18667
|
}
|
|
17818
18668
|
function DialogTrigger({
|
|
17819
18669
|
...props2
|
|
17820
18670
|
}) {
|
|
17821
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
18671
|
+
return /* @__PURE__ */ jsx(Trigger$7, { "data-slot": "dialog-trigger", ...props2 });
|
|
17822
18672
|
}
|
|
17823
18673
|
function DialogPortal({
|
|
17824
18674
|
...props2
|
|
@@ -17855,7 +18705,7 @@ function DialogContent({
|
|
|
17855
18705
|
return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
17856
18706
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
17857
18707
|
/* @__PURE__ */ jsxs(
|
|
17858
|
-
Content$
|
|
18708
|
+
Content$2,
|
|
17859
18709
|
{
|
|
17860
18710
|
"data-slot": "dialog-content",
|
|
17861
18711
|
className: cn$1(
|
|
@@ -17977,7 +18827,7 @@ function CommandInput({
|
|
|
17977
18827
|
"div",
|
|
17978
18828
|
{
|
|
17979
18829
|
"data-slot": "command-input-wrapper",
|
|
17980
|
-
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
18830
|
+
className: "flex h-9 items-center gap-2 border-b border-border px-3",
|
|
17981
18831
|
children: [
|
|
17982
18832
|
/* @__PURE__ */ jsx(Search, { className: "size-4 shrink-0 opacity-50" }),
|
|
17983
18833
|
/* @__PURE__ */ jsx(
|
|
@@ -18438,7 +19288,7 @@ function Autocomplete({
|
|
|
18438
19288
|
tabIndex: disabled ? -1 : 0,
|
|
18439
19289
|
"aria-disabled": disabled || void 0,
|
|
18440
19290
|
className: cn$1(
|
|
18441
|
-
"w-full inline-flex items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm transition-colors",
|
|
19291
|
+
"w-full inline-flex items-center justify-between rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm transition-colors",
|
|
18442
19292
|
"hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
18443
19293
|
disabled && "opacity-50 pointer-events-none",
|
|
18444
19294
|
className
|
|
@@ -18831,7 +19681,7 @@ function Input({ className, type, ...props2 }) {
|
|
|
18831
19681
|
type,
|
|
18832
19682
|
"data-slot": "input",
|
|
18833
19683
|
className: cn$1(
|
|
18834
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-
|
|
19684
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-border flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
18835
19685
|
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
18836
19686
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
18837
19687
|
className
|
|
@@ -18874,7 +19724,7 @@ function Textarea({ className, ...props2 }) {
|
|
|
18874
19724
|
{
|
|
18875
19725
|
"data-slot": "textarea",
|
|
18876
19726
|
className: cn$1(
|
|
18877
|
-
"border-
|
|
19727
|
+
"border-border placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
18878
19728
|
className
|
|
18879
19729
|
),
|
|
18880
19730
|
...props2
|
|
@@ -18910,7 +19760,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
18910
19760
|
whiteSpace: "nowrap",
|
|
18911
19761
|
wordWrap: "normal"
|
|
18912
19762
|
});
|
|
18913
|
-
var NAME$
|
|
19763
|
+
var NAME$2 = "VisuallyHidden";
|
|
18914
19764
|
var VisuallyHidden = React.forwardRef(
|
|
18915
19765
|
(props2, forwardedRef) => {
|
|
18916
19766
|
return /* @__PURE__ */ jsx(
|
|
@@ -18923,14 +19773,14 @@ var VisuallyHidden = React.forwardRef(
|
|
|
18923
19773
|
);
|
|
18924
19774
|
}
|
|
18925
19775
|
);
|
|
18926
|
-
VisuallyHidden.displayName = NAME$
|
|
18927
|
-
var Root$
|
|
19776
|
+
VisuallyHidden.displayName = NAME$2;
|
|
19777
|
+
var Root$9 = VisuallyHidden;
|
|
18928
19778
|
var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
18929
19779
|
var SELECTION_KEYS$1 = [" ", "Enter"];
|
|
18930
19780
|
var SELECT_NAME = "Select";
|
|
18931
|
-
var [Collection$
|
|
19781
|
+
var [Collection$4, useCollection$4, createCollectionScope$4] = createCollection(SELECT_NAME);
|
|
18932
19782
|
var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
|
|
18933
|
-
createCollectionScope$
|
|
19783
|
+
createCollectionScope$4,
|
|
18934
19784
|
createPopperScope
|
|
18935
19785
|
]);
|
|
18936
19786
|
var usePopperScope$3 = createPopperScope();
|
|
@@ -18974,7 +19824,7 @@ var Select$2 = (props2) => {
|
|
|
18974
19824
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
18975
19825
|
const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set());
|
|
18976
19826
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
18977
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
19827
|
+
return /* @__PURE__ */ jsx(Root2$9, { ...popperScope, children: /* @__PURE__ */ jsxs(
|
|
18978
19828
|
SelectProvider,
|
|
18979
19829
|
{
|
|
18980
19830
|
required: required2,
|
|
@@ -18994,7 +19844,7 @@ var Select$2 = (props2) => {
|
|
|
18994
19844
|
triggerPointerDownPosRef,
|
|
18995
19845
|
disabled,
|
|
18996
19846
|
children: [
|
|
18997
|
-
/* @__PURE__ */ jsx(Collection$
|
|
19847
|
+
/* @__PURE__ */ jsx(Collection$4.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(
|
|
18998
19848
|
SelectNativeOptionsProvider,
|
|
18999
19849
|
{
|
|
19000
19850
|
scope: props2.__scopeSelect,
|
|
@@ -19035,15 +19885,15 @@ var Select$2 = (props2) => {
|
|
|
19035
19885
|
) });
|
|
19036
19886
|
};
|
|
19037
19887
|
Select$2.displayName = SELECT_NAME;
|
|
19038
|
-
var TRIGGER_NAME$
|
|
19888
|
+
var TRIGGER_NAME$7 = "SelectTrigger";
|
|
19039
19889
|
var SelectTrigger$1 = React.forwardRef(
|
|
19040
19890
|
(props2, forwardedRef) => {
|
|
19041
19891
|
const { __scopeSelect, disabled = false, ...triggerProps } = props2;
|
|
19042
19892
|
const popperScope = usePopperScope$3(__scopeSelect);
|
|
19043
|
-
const context = useSelectContext(TRIGGER_NAME$
|
|
19893
|
+
const context = useSelectContext(TRIGGER_NAME$7, __scopeSelect);
|
|
19044
19894
|
const isDisabled = context.disabled || disabled;
|
|
19045
19895
|
const composedRefs = useComposedRefs$1(forwardedRef, context.onTriggerChange);
|
|
19046
|
-
const getItems = useCollection$
|
|
19896
|
+
const getItems = useCollection$4(__scopeSelect);
|
|
19047
19897
|
const pointerTypeRef = React.useRef("touch");
|
|
19048
19898
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
|
19049
19899
|
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
@@ -19112,7 +19962,7 @@ var SelectTrigger$1 = React.forwardRef(
|
|
|
19112
19962
|
) });
|
|
19113
19963
|
}
|
|
19114
19964
|
);
|
|
19115
|
-
SelectTrigger$1.displayName = TRIGGER_NAME$
|
|
19965
|
+
SelectTrigger$1.displayName = TRIGGER_NAME$7;
|
|
19116
19966
|
var VALUE_NAME = "SelectValue";
|
|
19117
19967
|
var SelectValue$1 = React.forwardRef(
|
|
19118
19968
|
(props2, forwardedRef) => {
|
|
@@ -19149,10 +19999,10 @@ var SelectPortal = (props2) => {
|
|
|
19149
19999
|
return /* @__PURE__ */ jsx(Portal$7, { asChild: true, ...props2 });
|
|
19150
20000
|
};
|
|
19151
20001
|
SelectPortal.displayName = PORTAL_NAME$7;
|
|
19152
|
-
var CONTENT_NAME$
|
|
20002
|
+
var CONTENT_NAME$8 = "SelectContent";
|
|
19153
20003
|
var SelectContent$1 = React.forwardRef(
|
|
19154
20004
|
(props2, forwardedRef) => {
|
|
19155
|
-
const context = useSelectContext(CONTENT_NAME$
|
|
20005
|
+
const context = useSelectContext(CONTENT_NAME$8, props2.__scopeSelect);
|
|
19156
20006
|
const [fragment, setFragment] = React.useState();
|
|
19157
20007
|
useLayoutEffect2(() => {
|
|
19158
20008
|
setFragment(new DocumentFragment());
|
|
@@ -19160,16 +20010,16 @@ var SelectContent$1 = React.forwardRef(
|
|
|
19160
20010
|
if (!context.open) {
|
|
19161
20011
|
const frag = fragment;
|
|
19162
20012
|
return frag ? ReactDOM.createPortal(
|
|
19163
|
-
/* @__PURE__ */ jsx(SelectContentProvider, { scope: props2.__scopeSelect, children: /* @__PURE__ */ jsx(Collection$
|
|
20013
|
+
/* @__PURE__ */ jsx(SelectContentProvider, { scope: props2.__scopeSelect, children: /* @__PURE__ */ jsx(Collection$4.Slot, { scope: props2.__scopeSelect, children: /* @__PURE__ */ jsx("div", { children: props2.children }) }) }),
|
|
19164
20014
|
frag
|
|
19165
20015
|
) : null;
|
|
19166
20016
|
}
|
|
19167
20017
|
return /* @__PURE__ */ jsx(SelectContentImpl, { ...props2, ref: forwardedRef });
|
|
19168
20018
|
}
|
|
19169
20019
|
);
|
|
19170
|
-
SelectContent$1.displayName = CONTENT_NAME$
|
|
20020
|
+
SelectContent$1.displayName = CONTENT_NAME$8;
|
|
19171
20021
|
var CONTENT_MARGIN = 10;
|
|
19172
|
-
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$
|
|
20022
|
+
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$8);
|
|
19173
20023
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
19174
20024
|
var Slot$1 = /* @__PURE__ */ createSlot("SelectContent.RemoveScroll");
|
|
19175
20025
|
var SelectContentImpl = React.forwardRef(
|
|
@@ -19195,7 +20045,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
19195
20045
|
//
|
|
19196
20046
|
...contentProps
|
|
19197
20047
|
} = props2;
|
|
19198
|
-
const context = useSelectContext(CONTENT_NAME$
|
|
20048
|
+
const context = useSelectContext(CONTENT_NAME$8, __scopeSelect);
|
|
19199
20049
|
const [content, setContent] = React.useState(null);
|
|
19200
20050
|
const [viewport, setViewport] = React.useState(null);
|
|
19201
20051
|
const composedRefs = useComposedRefs$1(forwardedRef, (node) => setContent(node));
|
|
@@ -19203,7 +20053,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
19203
20053
|
const [selectedItemText, setSelectedItemText] = React.useState(
|
|
19204
20054
|
null
|
|
19205
20055
|
);
|
|
19206
|
-
const getItems = useCollection$
|
|
20056
|
+
const getItems = useCollection$4(__scopeSelect);
|
|
19207
20057
|
const [isPositioned, setIsPositioned] = React.useState(false);
|
|
19208
20058
|
const firstValidItemFoundRef = React.useRef(false);
|
|
19209
20059
|
React.useEffect(() => {
|
|
@@ -19410,12 +20260,12 @@ SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
|
19410
20260
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
19411
20261
|
var SelectItemAlignedPosition = React.forwardRef((props2, forwardedRef) => {
|
|
19412
20262
|
const { __scopeSelect, onPlaced, ...popperProps } = props2;
|
|
19413
|
-
const context = useSelectContext(CONTENT_NAME$
|
|
19414
|
-
const contentContext = useSelectContentContext(CONTENT_NAME$
|
|
20263
|
+
const context = useSelectContext(CONTENT_NAME$8, __scopeSelect);
|
|
20264
|
+
const contentContext = useSelectContentContext(CONTENT_NAME$8, __scopeSelect);
|
|
19415
20265
|
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
19416
20266
|
const [content, setContent] = React.useState(null);
|
|
19417
20267
|
const composedRefs = useComposedRefs$1(forwardedRef, (node) => setContent(node));
|
|
19418
|
-
const getItems = useCollection$
|
|
20268
|
+
const getItems = useCollection$4(__scopeSelect);
|
|
19419
20269
|
const shouldExpandOnScrollRef = React.useRef(false);
|
|
19420
20270
|
const shouldRepositionRef = React.useRef(true);
|
|
19421
20271
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
@@ -19581,7 +20431,7 @@ var SelectPopperPosition = React.forwardRef((props2, forwardedRef) => {
|
|
|
19581
20431
|
} = props2;
|
|
19582
20432
|
const popperScope = usePopperScope$3(__scopeSelect);
|
|
19583
20433
|
return /* @__PURE__ */ jsx(
|
|
19584
|
-
Content$
|
|
20434
|
+
Content$3,
|
|
19585
20435
|
{
|
|
19586
20436
|
...popperScope,
|
|
19587
20437
|
...popperProps,
|
|
@@ -19605,7 +20455,7 @@ var SelectPopperPosition = React.forwardRef((props2, forwardedRef) => {
|
|
|
19605
20455
|
);
|
|
19606
20456
|
});
|
|
19607
20457
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
19608
|
-
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME$
|
|
20458
|
+
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME$8, {});
|
|
19609
20459
|
var VIEWPORT_NAME$2 = "SelectViewport";
|
|
19610
20460
|
var SelectViewport = React.forwardRef(
|
|
19611
20461
|
(props2, forwardedRef) => {
|
|
@@ -19624,7 +20474,7 @@ var SelectViewport = React.forwardRef(
|
|
|
19624
20474
|
nonce
|
|
19625
20475
|
}
|
|
19626
20476
|
),
|
|
19627
|
-
/* @__PURE__ */ jsx(Collection$
|
|
20477
|
+
/* @__PURE__ */ jsx(Collection$4.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(
|
|
19628
20478
|
Primitive.div,
|
|
19629
20479
|
{
|
|
19630
20480
|
"data-radix-select-viewport": "",
|
|
@@ -19674,8 +20524,8 @@ var SelectViewport = React.forwardRef(
|
|
|
19674
20524
|
}
|
|
19675
20525
|
);
|
|
19676
20526
|
SelectViewport.displayName = VIEWPORT_NAME$2;
|
|
19677
|
-
var GROUP_NAME$
|
|
19678
|
-
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME$
|
|
20527
|
+
var GROUP_NAME$4 = "SelectGroup";
|
|
20528
|
+
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME$4);
|
|
19679
20529
|
var SelectGroup$1 = React.forwardRef(
|
|
19680
20530
|
(props2, forwardedRef) => {
|
|
19681
20531
|
const { __scopeSelect, ...groupProps } = props2;
|
|
@@ -19683,7 +20533,7 @@ var SelectGroup$1 = React.forwardRef(
|
|
|
19683
20533
|
return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
19684
20534
|
}
|
|
19685
20535
|
);
|
|
19686
|
-
SelectGroup$1.displayName = GROUP_NAME$
|
|
20536
|
+
SelectGroup$1.displayName = GROUP_NAME$4;
|
|
19687
20537
|
var LABEL_NAME$4 = "SelectLabel";
|
|
19688
20538
|
var SelectLabel$1 = React.forwardRef(
|
|
19689
20539
|
(props2, forwardedRef) => {
|
|
@@ -19693,8 +20543,8 @@ var SelectLabel$1 = React.forwardRef(
|
|
|
19693
20543
|
}
|
|
19694
20544
|
);
|
|
19695
20545
|
SelectLabel$1.displayName = LABEL_NAME$4;
|
|
19696
|
-
var ITEM_NAME$
|
|
19697
|
-
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME$
|
|
20546
|
+
var ITEM_NAME$7 = "SelectItem";
|
|
20547
|
+
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME$7);
|
|
19698
20548
|
var SelectItem$1 = React.forwardRef(
|
|
19699
20549
|
(props2, forwardedRef) => {
|
|
19700
20550
|
const {
|
|
@@ -19704,8 +20554,8 @@ var SelectItem$1 = React.forwardRef(
|
|
|
19704
20554
|
textValue: textValueProp,
|
|
19705
20555
|
...itemProps
|
|
19706
20556
|
} = props2;
|
|
19707
|
-
const context = useSelectContext(ITEM_NAME$
|
|
19708
|
-
const contentContext = useSelectContentContext(ITEM_NAME$
|
|
20557
|
+
const context = useSelectContext(ITEM_NAME$7, __scopeSelect);
|
|
20558
|
+
const contentContext = useSelectContentContext(ITEM_NAME$7, __scopeSelect);
|
|
19709
20559
|
const isSelected = context.value === value;
|
|
19710
20560
|
const [textValue, setTextValue] = React.useState(textValueProp ?? "");
|
|
19711
20561
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
@@ -19741,7 +20591,7 @@ var SelectItem$1 = React.forwardRef(
|
|
|
19741
20591
|
setTextValue((prevTextValue) => prevTextValue || ((node == null ? void 0 : node.textContent) ?? "").trim());
|
|
19742
20592
|
}, []),
|
|
19743
20593
|
children: /* @__PURE__ */ jsx(
|
|
19744
|
-
Collection$
|
|
20594
|
+
Collection$4.ItemSlot,
|
|
19745
20595
|
{
|
|
19746
20596
|
scope: __scopeSelect,
|
|
19747
20597
|
value,
|
|
@@ -19801,7 +20651,7 @@ var SelectItem$1 = React.forwardRef(
|
|
|
19801
20651
|
);
|
|
19802
20652
|
}
|
|
19803
20653
|
);
|
|
19804
|
-
SelectItem$1.displayName = ITEM_NAME$
|
|
20654
|
+
SelectItem$1.displayName = ITEM_NAME$7;
|
|
19805
20655
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
19806
20656
|
var SelectItemText = React.forwardRef(
|
|
19807
20657
|
(props2, forwardedRef) => {
|
|
@@ -19917,7 +20767,7 @@ var SelectScrollButtonImpl = React.forwardRef((props2, forwardedRef) => {
|
|
|
19917
20767
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props2;
|
|
19918
20768
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
19919
20769
|
const autoScrollTimerRef = React.useRef(null);
|
|
19920
|
-
const getItems = useCollection$
|
|
20770
|
+
const getItems = useCollection$4(__scopeSelect);
|
|
19921
20771
|
const clearAutoScrollTimer = React.useCallback(() => {
|
|
19922
20772
|
if (autoScrollTimerRef.current !== null) {
|
|
19923
20773
|
window.clearInterval(autoScrollTimerRef.current);
|
|
@@ -20041,7 +20891,7 @@ function findNextItem(items, search, currentItem) {
|
|
|
20041
20891
|
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
|
|
20042
20892
|
const normalizedSearch = isRepeated ? search[0] : search;
|
|
20043
20893
|
const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;
|
|
20044
|
-
let wrappedItems = wrapArray$
|
|
20894
|
+
let wrappedItems = wrapArray$2(items, Math.max(currentItemIndex, 0));
|
|
20045
20895
|
const excludeCurrentItem = normalizedSearch.length === 1;
|
|
20046
20896
|
if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);
|
|
20047
20897
|
const nextItem = wrappedItems.find(
|
|
@@ -20049,11 +20899,11 @@ function findNextItem(items, search, currentItem) {
|
|
|
20049
20899
|
);
|
|
20050
20900
|
return nextItem !== currentItem ? nextItem : void 0;
|
|
20051
20901
|
}
|
|
20052
|
-
function wrapArray$
|
|
20902
|
+
function wrapArray$2(array2, startIndex) {
|
|
20053
20903
|
return array2.map((_2, index2) => array2[(startIndex + index2) % array2.length]);
|
|
20054
20904
|
}
|
|
20055
|
-
var Root2$
|
|
20056
|
-
var Trigger$
|
|
20905
|
+
var Root2$7 = Select$2;
|
|
20906
|
+
var Trigger$6 = SelectTrigger$1;
|
|
20057
20907
|
var Value = SelectValue$1;
|
|
20058
20908
|
var Icon = SelectIcon;
|
|
20059
20909
|
var Portal$4 = SelectPortal;
|
|
@@ -20061,16 +20911,16 @@ var Content2$7 = SelectContent$1;
|
|
|
20061
20911
|
var Viewport$2 = SelectViewport;
|
|
20062
20912
|
var Group$1 = SelectGroup$1;
|
|
20063
20913
|
var Label$1 = SelectLabel$1;
|
|
20064
|
-
var Item$
|
|
20914
|
+
var Item$1 = SelectItem$1;
|
|
20065
20915
|
var ItemText = SelectItemText;
|
|
20066
20916
|
var ItemIndicator$1 = SelectItemIndicator;
|
|
20067
20917
|
var ScrollUpButton = SelectScrollUpButton$1;
|
|
20068
20918
|
var ScrollDownButton = SelectScrollDownButton$1;
|
|
20069
|
-
var Separator$
|
|
20919
|
+
var Separator$1 = SelectSeparator$1;
|
|
20070
20920
|
function Select$1({
|
|
20071
20921
|
...props2
|
|
20072
20922
|
}) {
|
|
20073
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
20923
|
+
return /* @__PURE__ */ jsx(Root2$7, { "data-slot": "select", ...props2 });
|
|
20074
20924
|
}
|
|
20075
20925
|
function SelectGroup({
|
|
20076
20926
|
...props2
|
|
@@ -20089,12 +20939,12 @@ function SelectTrigger({
|
|
|
20089
20939
|
...props2
|
|
20090
20940
|
}) {
|
|
20091
20941
|
return /* @__PURE__ */ jsxs(
|
|
20092
|
-
Trigger$
|
|
20942
|
+
Trigger$6,
|
|
20093
20943
|
{
|
|
20094
20944
|
"data-slot": "select-trigger",
|
|
20095
20945
|
"data-size": size2,
|
|
20096
20946
|
className: cn$1(
|
|
20097
|
-
"border-
|
|
20947
|
+
"border-border data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
20098
20948
|
className
|
|
20099
20949
|
),
|
|
20100
20950
|
...props2,
|
|
@@ -20158,7 +21008,7 @@ function SelectItem({
|
|
|
20158
21008
|
...props2
|
|
20159
21009
|
}) {
|
|
20160
21010
|
return /* @__PURE__ */ jsxs(
|
|
20161
|
-
Item$
|
|
21011
|
+
Item$1,
|
|
20162
21012
|
{
|
|
20163
21013
|
"data-slot": "select-item",
|
|
20164
21014
|
className: cn$1(
|
|
@@ -20178,7 +21028,7 @@ function SelectSeparator({
|
|
|
20178
21028
|
...props2
|
|
20179
21029
|
}) {
|
|
20180
21030
|
return /* @__PURE__ */ jsx(
|
|
20181
|
-
Separator$
|
|
21031
|
+
Separator$1,
|
|
20182
21032
|
{
|
|
20183
21033
|
"data-slot": "select-separator",
|
|
20184
21034
|
className: cn$1("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
@@ -20431,14 +21281,14 @@ SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME$2;
|
|
|
20431
21281
|
function getState$1(checked) {
|
|
20432
21282
|
return checked ? "checked" : "unchecked";
|
|
20433
21283
|
}
|
|
20434
|
-
var Root$
|
|
21284
|
+
var Root$8 = Switch$1;
|
|
20435
21285
|
var Thumb$1 = SwitchThumb;
|
|
20436
21286
|
function Switch({
|
|
20437
21287
|
className,
|
|
20438
21288
|
...props2
|
|
20439
21289
|
}) {
|
|
20440
21290
|
return /* @__PURE__ */ jsx(
|
|
20441
|
-
Root$
|
|
21291
|
+
Root$8,
|
|
20442
21292
|
{
|
|
20443
21293
|
"data-slot": "switch",
|
|
20444
21294
|
className: cn$1(
|
|
@@ -20509,215 +21359,6 @@ function SwitchField({ field, fieldPath, value, onChange, className }) {
|
|
|
20509
21359
|
] })
|
|
20510
21360
|
] });
|
|
20511
21361
|
}
|
|
20512
|
-
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
20513
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
20514
|
-
var GROUP_NAME$4 = "RovingFocusGroup";
|
|
20515
|
-
var [Collection$4, useCollection$4, createCollectionScope$4] = createCollection(GROUP_NAME$4);
|
|
20516
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
20517
|
-
GROUP_NAME$4,
|
|
20518
|
-
[createCollectionScope$4]
|
|
20519
|
-
);
|
|
20520
|
-
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$4);
|
|
20521
|
-
var RovingFocusGroup = React.forwardRef(
|
|
20522
|
-
(props2, forwardedRef) => {
|
|
20523
|
-
return /* @__PURE__ */ jsx(Collection$4.Provider, { scope: props2.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection$4.Slot, { scope: props2.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props2, ref: forwardedRef }) }) });
|
|
20524
|
-
}
|
|
20525
|
-
);
|
|
20526
|
-
RovingFocusGroup.displayName = GROUP_NAME$4;
|
|
20527
|
-
var RovingFocusGroupImpl = React.forwardRef((props2, forwardedRef) => {
|
|
20528
|
-
const {
|
|
20529
|
-
__scopeRovingFocusGroup,
|
|
20530
|
-
orientation,
|
|
20531
|
-
loop = false,
|
|
20532
|
-
dir,
|
|
20533
|
-
currentTabStopId: currentTabStopIdProp,
|
|
20534
|
-
defaultCurrentTabStopId,
|
|
20535
|
-
onCurrentTabStopIdChange,
|
|
20536
|
-
onEntryFocus,
|
|
20537
|
-
preventScrollOnEntryFocus = false,
|
|
20538
|
-
...groupProps
|
|
20539
|
-
} = props2;
|
|
20540
|
-
const ref = React.useRef(null);
|
|
20541
|
-
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
20542
|
-
const direction = useDirection(dir);
|
|
20543
|
-
const [currentTabStopId, setCurrentTabStopId] = useControllableState$1({
|
|
20544
|
-
prop: currentTabStopIdProp,
|
|
20545
|
-
defaultProp: defaultCurrentTabStopId ?? null,
|
|
20546
|
-
onChange: onCurrentTabStopIdChange,
|
|
20547
|
-
caller: GROUP_NAME$4
|
|
20548
|
-
});
|
|
20549
|
-
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
20550
|
-
const handleEntryFocus = useCallbackRef$2(onEntryFocus);
|
|
20551
|
-
const getItems = useCollection$4(__scopeRovingFocusGroup);
|
|
20552
|
-
const isClickFocusRef = React.useRef(false);
|
|
20553
|
-
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
20554
|
-
React.useEffect(() => {
|
|
20555
|
-
const node = ref.current;
|
|
20556
|
-
if (node) {
|
|
20557
|
-
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
20558
|
-
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
20559
|
-
}
|
|
20560
|
-
}, [handleEntryFocus]);
|
|
20561
|
-
return /* @__PURE__ */ jsx(
|
|
20562
|
-
RovingFocusProvider,
|
|
20563
|
-
{
|
|
20564
|
-
scope: __scopeRovingFocusGroup,
|
|
20565
|
-
orientation,
|
|
20566
|
-
dir: direction,
|
|
20567
|
-
loop,
|
|
20568
|
-
currentTabStopId,
|
|
20569
|
-
onItemFocus: React.useCallback(
|
|
20570
|
-
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
20571
|
-
[setCurrentTabStopId]
|
|
20572
|
-
),
|
|
20573
|
-
onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
|
|
20574
|
-
onFocusableItemAdd: React.useCallback(
|
|
20575
|
-
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
20576
|
-
[]
|
|
20577
|
-
),
|
|
20578
|
-
onFocusableItemRemove: React.useCallback(
|
|
20579
|
-
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
20580
|
-
[]
|
|
20581
|
-
),
|
|
20582
|
-
children: /* @__PURE__ */ jsx(
|
|
20583
|
-
Primitive.div,
|
|
20584
|
-
{
|
|
20585
|
-
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
20586
|
-
"data-orientation": orientation,
|
|
20587
|
-
...groupProps,
|
|
20588
|
-
ref: composedRefs,
|
|
20589
|
-
style: { outline: "none", ...props2.style },
|
|
20590
|
-
onMouseDown: composeEventHandlers$1(props2.onMouseDown, () => {
|
|
20591
|
-
isClickFocusRef.current = true;
|
|
20592
|
-
}),
|
|
20593
|
-
onFocus: composeEventHandlers$1(props2.onFocus, (event) => {
|
|
20594
|
-
const isKeyboardFocus = !isClickFocusRef.current;
|
|
20595
|
-
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
20596
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
20597
|
-
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
20598
|
-
if (!entryFocusEvent.defaultPrevented) {
|
|
20599
|
-
const items = getItems().filter((item) => item.focusable);
|
|
20600
|
-
const activeItem = items.find((item) => item.active);
|
|
20601
|
-
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
20602
|
-
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
20603
|
-
Boolean
|
|
20604
|
-
);
|
|
20605
|
-
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
20606
|
-
focusFirst$2(candidateNodes, preventScrollOnEntryFocus);
|
|
20607
|
-
}
|
|
20608
|
-
}
|
|
20609
|
-
isClickFocusRef.current = false;
|
|
20610
|
-
}),
|
|
20611
|
-
onBlur: composeEventHandlers$1(props2.onBlur, () => setIsTabbingBackOut(false))
|
|
20612
|
-
}
|
|
20613
|
-
)
|
|
20614
|
-
}
|
|
20615
|
-
);
|
|
20616
|
-
});
|
|
20617
|
-
var ITEM_NAME$7 = "RovingFocusGroupItem";
|
|
20618
|
-
var RovingFocusGroupItem = React.forwardRef(
|
|
20619
|
-
(props2, forwardedRef) => {
|
|
20620
|
-
const {
|
|
20621
|
-
__scopeRovingFocusGroup,
|
|
20622
|
-
focusable = true,
|
|
20623
|
-
active = false,
|
|
20624
|
-
tabStopId,
|
|
20625
|
-
children,
|
|
20626
|
-
...itemProps
|
|
20627
|
-
} = props2;
|
|
20628
|
-
const autoId = useId$1();
|
|
20629
|
-
const id = tabStopId || autoId;
|
|
20630
|
-
const context = useRovingFocusContext(ITEM_NAME$7, __scopeRovingFocusGroup);
|
|
20631
|
-
const isCurrentTabStop = context.currentTabStopId === id;
|
|
20632
|
-
const getItems = useCollection$4(__scopeRovingFocusGroup);
|
|
20633
|
-
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
20634
|
-
React.useEffect(() => {
|
|
20635
|
-
if (focusable) {
|
|
20636
|
-
onFocusableItemAdd();
|
|
20637
|
-
return () => onFocusableItemRemove();
|
|
20638
|
-
}
|
|
20639
|
-
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
20640
|
-
return /* @__PURE__ */ jsx(
|
|
20641
|
-
Collection$4.ItemSlot,
|
|
20642
|
-
{
|
|
20643
|
-
scope: __scopeRovingFocusGroup,
|
|
20644
|
-
id,
|
|
20645
|
-
focusable,
|
|
20646
|
-
active,
|
|
20647
|
-
children: /* @__PURE__ */ jsx(
|
|
20648
|
-
Primitive.span,
|
|
20649
|
-
{
|
|
20650
|
-
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
20651
|
-
"data-orientation": context.orientation,
|
|
20652
|
-
...itemProps,
|
|
20653
|
-
ref: forwardedRef,
|
|
20654
|
-
onMouseDown: composeEventHandlers$1(props2.onMouseDown, (event) => {
|
|
20655
|
-
if (!focusable) event.preventDefault();
|
|
20656
|
-
else context.onItemFocus(id);
|
|
20657
|
-
}),
|
|
20658
|
-
onFocus: composeEventHandlers$1(props2.onFocus, () => context.onItemFocus(id)),
|
|
20659
|
-
onKeyDown: composeEventHandlers$1(props2.onKeyDown, (event) => {
|
|
20660
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
20661
|
-
context.onItemShiftTab();
|
|
20662
|
-
return;
|
|
20663
|
-
}
|
|
20664
|
-
if (event.target !== event.currentTarget) return;
|
|
20665
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
20666
|
-
if (focusIntent !== void 0) {
|
|
20667
|
-
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
20668
|
-
event.preventDefault();
|
|
20669
|
-
const items = getItems().filter((item) => item.focusable);
|
|
20670
|
-
let candidateNodes = items.map((item) => item.ref.current);
|
|
20671
|
-
if (focusIntent === "last") candidateNodes.reverse();
|
|
20672
|
-
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
20673
|
-
if (focusIntent === "prev") candidateNodes.reverse();
|
|
20674
|
-
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
20675
|
-
candidateNodes = context.loop ? wrapArray$2(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
20676
|
-
}
|
|
20677
|
-
setTimeout(() => focusFirst$2(candidateNodes));
|
|
20678
|
-
}
|
|
20679
|
-
}),
|
|
20680
|
-
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
20681
|
-
}
|
|
20682
|
-
)
|
|
20683
|
-
}
|
|
20684
|
-
);
|
|
20685
|
-
}
|
|
20686
|
-
);
|
|
20687
|
-
RovingFocusGroupItem.displayName = ITEM_NAME$7;
|
|
20688
|
-
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
20689
|
-
ArrowLeft: "prev",
|
|
20690
|
-
ArrowUp: "prev",
|
|
20691
|
-
ArrowRight: "next",
|
|
20692
|
-
ArrowDown: "next",
|
|
20693
|
-
PageUp: "first",
|
|
20694
|
-
Home: "first",
|
|
20695
|
-
PageDown: "last",
|
|
20696
|
-
End: "last"
|
|
20697
|
-
};
|
|
20698
|
-
function getDirectionAwareKey(key, dir) {
|
|
20699
|
-
if (dir !== "rtl") return key;
|
|
20700
|
-
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
20701
|
-
}
|
|
20702
|
-
function getFocusIntent(event, orientation, dir) {
|
|
20703
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
20704
|
-
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
20705
|
-
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
20706
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
20707
|
-
}
|
|
20708
|
-
function focusFirst$2(candidates, preventScroll = false) {
|
|
20709
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
20710
|
-
for (const candidate of candidates) {
|
|
20711
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
20712
|
-
candidate.focus({ preventScroll });
|
|
20713
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
20714
|
-
}
|
|
20715
|
-
}
|
|
20716
|
-
function wrapArray$2(array2, startIndex) {
|
|
20717
|
-
return array2.map((_2, index2) => array2[(startIndex + index2) % array2.length]);
|
|
20718
|
-
}
|
|
20719
|
-
var Root$9 = RovingFocusGroup;
|
|
20720
|
-
var Item$1 = RovingFocusGroupItem;
|
|
20721
21362
|
var RADIO_NAME = "Radio";
|
|
20722
21363
|
var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);
|
|
20723
21364
|
var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
|
|
@@ -20854,7 +21495,7 @@ var [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_
|
|
|
20854
21495
|
createRovingFocusGroupScope,
|
|
20855
21496
|
createRadioScope
|
|
20856
21497
|
]);
|
|
20857
|
-
var useRovingFocusGroupScope$
|
|
21498
|
+
var useRovingFocusGroupScope$3 = createRovingFocusGroupScope();
|
|
20858
21499
|
var useRadioScope = createRadioScope();
|
|
20859
21500
|
var [RadioGroupProvider$1, useRadioGroupContext$1] = createRadioGroupContext(RADIO_GROUP_NAME$4);
|
|
20860
21501
|
var RadioGroup$2 = React.forwardRef(
|
|
@@ -20872,7 +21513,7 @@ var RadioGroup$2 = React.forwardRef(
|
|
|
20872
21513
|
onValueChange,
|
|
20873
21514
|
...groupProps
|
|
20874
21515
|
} = props2;
|
|
20875
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope$
|
|
21516
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope$3(__scopeRadioGroup);
|
|
20876
21517
|
const direction = useDirection(dir);
|
|
20877
21518
|
const [value, setValue] = useControllableState$1({
|
|
20878
21519
|
prop: valueProp,
|
|
@@ -20890,7 +21531,7 @@ var RadioGroup$2 = React.forwardRef(
|
|
|
20890
21531
|
value,
|
|
20891
21532
|
onValueChange: setValue,
|
|
20892
21533
|
children: /* @__PURE__ */ jsx(
|
|
20893
|
-
Root$
|
|
21534
|
+
Root$d,
|
|
20894
21535
|
{
|
|
20895
21536
|
asChild: true,
|
|
20896
21537
|
...rovingFocusGroupScope,
|
|
@@ -20922,7 +21563,7 @@ var RadioGroupItem$1 = React.forwardRef(
|
|
|
20922
21563
|
const { __scopeRadioGroup, disabled, ...itemProps } = props2;
|
|
20923
21564
|
const context = useRadioGroupContext$1(ITEM_NAME$6, __scopeRadioGroup);
|
|
20924
21565
|
const isDisabled = context.disabled || disabled;
|
|
20925
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope$
|
|
21566
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope$3(__scopeRadioGroup);
|
|
20926
21567
|
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
20927
21568
|
const ref = React.useRef(null);
|
|
20928
21569
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
@@ -20943,7 +21584,7 @@ var RadioGroupItem$1 = React.forwardRef(
|
|
|
20943
21584
|
};
|
|
20944
21585
|
}, []);
|
|
20945
21586
|
return /* @__PURE__ */ jsx(
|
|
20946
|
-
Item$
|
|
21587
|
+
Item$2,
|
|
20947
21588
|
{
|
|
20948
21589
|
asChild: true,
|
|
20949
21590
|
...rovingFocusGroupScope,
|
|
@@ -20983,7 +21624,7 @@ var RadioGroupIndicator = React.forwardRef(
|
|
|
20983
21624
|
}
|
|
20984
21625
|
);
|
|
20985
21626
|
RadioGroupIndicator.displayName = INDICATOR_NAME2;
|
|
20986
|
-
var Root2$
|
|
21627
|
+
var Root2$6 = RadioGroup$2;
|
|
20987
21628
|
var Item2$4 = RadioGroupItem$1;
|
|
20988
21629
|
var Indicator$2 = RadioGroupIndicator;
|
|
20989
21630
|
function RadioGroup$1({
|
|
@@ -20991,7 +21632,7 @@ function RadioGroup$1({
|
|
|
20991
21632
|
...props2
|
|
20992
21633
|
}) {
|
|
20993
21634
|
return /* @__PURE__ */ jsx(
|
|
20994
|
-
Root2$
|
|
21635
|
+
Root2$6,
|
|
20995
21636
|
{
|
|
20996
21637
|
"data-slot": "radio-group",
|
|
20997
21638
|
className: cn$1("grid gap-3", className),
|
|
@@ -23384,7 +24025,7 @@ function PreviousMonthButton(props2) {
|
|
|
23384
24025
|
const { components: components2 } = useDayPicker();
|
|
23385
24026
|
return React__default.createElement(components2.Button, { ...props2 });
|
|
23386
24027
|
}
|
|
23387
|
-
function Root$
|
|
24028
|
+
function Root$7(props2) {
|
|
23388
24029
|
const { rootRef, ...rest } = props2;
|
|
23389
24030
|
return React__default.createElement("div", { ...rest, ref: rootRef });
|
|
23390
24031
|
}
|
|
@@ -23438,7 +24079,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
23438
24079
|
NextMonthButton,
|
|
23439
24080
|
Option,
|
|
23440
24081
|
PreviousMonthButton,
|
|
23441
|
-
Root: Root$
|
|
24082
|
+
Root: Root$7,
|
|
23442
24083
|
Select,
|
|
23443
24084
|
Week,
|
|
23444
24085
|
WeekNumber,
|
|
@@ -30730,7 +31371,7 @@ function getInvalidValueError(propValue, componentName) {
|
|
|
30730
31371
|
|
|
30731
31372
|
Defaulting to \`null\`.`;
|
|
30732
31373
|
}
|
|
30733
|
-
var Root$
|
|
31374
|
+
var Root$6 = Progress$1;
|
|
30734
31375
|
var Indicator$1 = ProgressIndicator;
|
|
30735
31376
|
function Progress({
|
|
30736
31377
|
className,
|
|
@@ -30738,7 +31379,7 @@ function Progress({
|
|
|
30738
31379
|
...props2
|
|
30739
31380
|
}) {
|
|
30740
31381
|
return /* @__PURE__ */ jsx(
|
|
30741
|
-
Root$
|
|
31382
|
+
Root$6,
|
|
30742
31383
|
{
|
|
30743
31384
|
"data-slot": "progress",
|
|
30744
31385
|
className: cn$1(
|
|
@@ -30871,7 +31512,7 @@ var Tooltip$2 = (props2) => {
|
|
|
30871
31512
|
}
|
|
30872
31513
|
};
|
|
30873
31514
|
}, []);
|
|
30874
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
31515
|
+
return /* @__PURE__ */ jsx(Root2$9, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
30875
31516
|
TooltipContextProvider,
|
|
30876
31517
|
{
|
|
30877
31518
|
scope: __scopeTooltip,
|
|
@@ -30900,12 +31541,12 @@ var Tooltip$2 = (props2) => {
|
|
|
30900
31541
|
) });
|
|
30901
31542
|
};
|
|
30902
31543
|
Tooltip$2.displayName = TOOLTIP_NAME;
|
|
30903
|
-
var TRIGGER_NAME$
|
|
31544
|
+
var TRIGGER_NAME$6 = "TooltipTrigger";
|
|
30904
31545
|
var TooltipTrigger$1 = React.forwardRef(
|
|
30905
31546
|
(props2, forwardedRef) => {
|
|
30906
31547
|
const { __scopeTooltip, ...triggerProps } = props2;
|
|
30907
|
-
const context = useTooltipContext(TRIGGER_NAME$
|
|
30908
|
-
const providerContext = useTooltipProviderContext(TRIGGER_NAME$
|
|
31548
|
+
const context = useTooltipContext(TRIGGER_NAME$6, __scopeTooltip);
|
|
31549
|
+
const providerContext = useTooltipProviderContext(TRIGGER_NAME$6, __scopeTooltip);
|
|
30909
31550
|
const popperScope = usePopperScope$2(__scopeTooltip);
|
|
30910
31551
|
const ref = React.useRef(null);
|
|
30911
31552
|
const composedRefs = useComposedRefs$1(forwardedRef, ref, context.onTriggerChange);
|
|
@@ -30949,7 +31590,7 @@ var TooltipTrigger$1 = React.forwardRef(
|
|
|
30949
31590
|
) });
|
|
30950
31591
|
}
|
|
30951
31592
|
);
|
|
30952
|
-
TooltipTrigger$1.displayName = TRIGGER_NAME$
|
|
31593
|
+
TooltipTrigger$1.displayName = TRIGGER_NAME$6;
|
|
30953
31594
|
var PORTAL_NAME$6 = "TooltipPortal";
|
|
30954
31595
|
var [PortalProvider$2, usePortalContext$2] = createTooltipContext(PORTAL_NAME$6, {
|
|
30955
31596
|
forceMount: void 0
|
|
@@ -30960,18 +31601,18 @@ var TooltipPortal = (props2) => {
|
|
|
30960
31601
|
return /* @__PURE__ */ jsx(PortalProvider$2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$7, { asChild: true, container, children }) }) });
|
|
30961
31602
|
};
|
|
30962
31603
|
TooltipPortal.displayName = PORTAL_NAME$6;
|
|
30963
|
-
var CONTENT_NAME$
|
|
31604
|
+
var CONTENT_NAME$7 = "TooltipContent";
|
|
30964
31605
|
var TooltipContent$1 = React.forwardRef(
|
|
30965
31606
|
(props2, forwardedRef) => {
|
|
30966
|
-
const portalContext = usePortalContext$2(CONTENT_NAME$
|
|
31607
|
+
const portalContext = usePortalContext$2(CONTENT_NAME$7, props2.__scopeTooltip);
|
|
30967
31608
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props2;
|
|
30968
|
-
const context = useTooltipContext(CONTENT_NAME$
|
|
31609
|
+
const context = useTooltipContext(CONTENT_NAME$7, props2.__scopeTooltip);
|
|
30969
31610
|
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
30970
31611
|
}
|
|
30971
31612
|
);
|
|
30972
31613
|
var TooltipContentHoverable = React.forwardRef((props2, forwardedRef) => {
|
|
30973
|
-
const context = useTooltipContext(CONTENT_NAME$
|
|
30974
|
-
const providerContext = useTooltipProviderContext(CONTENT_NAME$
|
|
31614
|
+
const context = useTooltipContext(CONTENT_NAME$7, props2.__scopeTooltip);
|
|
31615
|
+
const providerContext = useTooltipProviderContext(CONTENT_NAME$7, props2.__scopeTooltip);
|
|
30975
31616
|
const ref = React.useRef(null);
|
|
30976
31617
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
30977
31618
|
const [pointerGraceArea, setPointerGraceArea] = React.useState(null);
|
|
@@ -31042,7 +31683,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
31042
31683
|
onPointerDownOutside,
|
|
31043
31684
|
...contentProps
|
|
31044
31685
|
} = props2;
|
|
31045
|
-
const context = useTooltipContext(CONTENT_NAME$
|
|
31686
|
+
const context = useTooltipContext(CONTENT_NAME$7, __scopeTooltip);
|
|
31046
31687
|
const popperScope = usePopperScope$2(__scopeTooltip);
|
|
31047
31688
|
const { onClose } = context;
|
|
31048
31689
|
React.useEffect(() => {
|
|
@@ -31069,7 +31710,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
31069
31710
|
onFocusOutside: (event) => event.preventDefault(),
|
|
31070
31711
|
onDismiss: onClose,
|
|
31071
31712
|
children: /* @__PURE__ */ jsxs(
|
|
31072
|
-
Content$
|
|
31713
|
+
Content$3,
|
|
31073
31714
|
{
|
|
31074
31715
|
"data-state": context.stateAttribute,
|
|
31075
31716
|
...popperScope,
|
|
@@ -31088,7 +31729,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
31088
31729
|
},
|
|
31089
31730
|
children: [
|
|
31090
31731
|
/* @__PURE__ */ jsx(Slottable$1, { children }),
|
|
31091
|
-
/* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$
|
|
31732
|
+
/* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$9, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
31092
31733
|
]
|
|
31093
31734
|
}
|
|
31094
31735
|
)
|
|
@@ -31096,7 +31737,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
31096
31737
|
);
|
|
31097
31738
|
}
|
|
31098
31739
|
);
|
|
31099
|
-
TooltipContent$1.displayName = CONTENT_NAME$
|
|
31740
|
+
TooltipContent$1.displayName = CONTENT_NAME$7;
|
|
31100
31741
|
var ARROW_NAME$5 = "TooltipArrow";
|
|
31101
31742
|
var TooltipArrow = React.forwardRef(
|
|
31102
31743
|
(props2, forwardedRef) => {
|
|
@@ -31227,7 +31868,7 @@ function getHullPresorted(points) {
|
|
|
31227
31868
|
}
|
|
31228
31869
|
var Provider = TooltipProvider$1;
|
|
31229
31870
|
var Root3$2 = Tooltip$2;
|
|
31230
|
-
var Trigger$
|
|
31871
|
+
var Trigger$5 = TooltipTrigger$1;
|
|
31231
31872
|
var Portal$3 = TooltipPortal;
|
|
31232
31873
|
var Content2$6 = TooltipContent$1;
|
|
31233
31874
|
var Arrow2$1 = TooltipArrow;
|
|
@@ -31252,7 +31893,7 @@ function Tooltip$1({
|
|
|
31252
31893
|
function TooltipTrigger({
|
|
31253
31894
|
...props2
|
|
31254
31895
|
}) {
|
|
31255
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
31896
|
+
return /* @__PURE__ */ jsx(Trigger$5, { "data-slot": "tooltip-trigger", ...props2 });
|
|
31256
31897
|
}
|
|
31257
31898
|
function TooltipContent({
|
|
31258
31899
|
className,
|
|
@@ -31697,85 +32338,6 @@ function FileField({ field, value, onChange, className }) {
|
|
|
31697
32338
|
}
|
|
31698
32339
|
);
|
|
31699
32340
|
}
|
|
31700
|
-
function Card({ className, ...props2 }) {
|
|
31701
|
-
return /* @__PURE__ */ jsx(
|
|
31702
|
-
"div",
|
|
31703
|
-
{
|
|
31704
|
-
"data-slot": "card",
|
|
31705
|
-
className: cn$1(
|
|
31706
|
-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
31707
|
-
className
|
|
31708
|
-
),
|
|
31709
|
-
...props2
|
|
31710
|
-
}
|
|
31711
|
-
);
|
|
31712
|
-
}
|
|
31713
|
-
function CardHeader({ className, ...props2 }) {
|
|
31714
|
-
return /* @__PURE__ */ jsx(
|
|
31715
|
-
"div",
|
|
31716
|
-
{
|
|
31717
|
-
"data-slot": "card-header",
|
|
31718
|
-
className: cn$1(
|
|
31719
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
31720
|
-
className
|
|
31721
|
-
),
|
|
31722
|
-
...props2
|
|
31723
|
-
}
|
|
31724
|
-
);
|
|
31725
|
-
}
|
|
31726
|
-
function CardTitle({ className, ...props2 }) {
|
|
31727
|
-
return /* @__PURE__ */ jsx(
|
|
31728
|
-
"div",
|
|
31729
|
-
{
|
|
31730
|
-
"data-slot": "card-title",
|
|
31731
|
-
className: cn$1("leading-none font-semibold", className),
|
|
31732
|
-
...props2
|
|
31733
|
-
}
|
|
31734
|
-
);
|
|
31735
|
-
}
|
|
31736
|
-
function CardDescription({ className, ...props2 }) {
|
|
31737
|
-
return /* @__PURE__ */ jsx(
|
|
31738
|
-
"div",
|
|
31739
|
-
{
|
|
31740
|
-
"data-slot": "card-description",
|
|
31741
|
-
className: cn$1("text-muted-foreground text-sm", className),
|
|
31742
|
-
...props2
|
|
31743
|
-
}
|
|
31744
|
-
);
|
|
31745
|
-
}
|
|
31746
|
-
function CardAction({ className, ...props2 }) {
|
|
31747
|
-
return /* @__PURE__ */ jsx(
|
|
31748
|
-
"div",
|
|
31749
|
-
{
|
|
31750
|
-
"data-slot": "card-action",
|
|
31751
|
-
className: cn$1(
|
|
31752
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
31753
|
-
className
|
|
31754
|
-
),
|
|
31755
|
-
...props2
|
|
31756
|
-
}
|
|
31757
|
-
);
|
|
31758
|
-
}
|
|
31759
|
-
function CardContent({ className, ...props2 }) {
|
|
31760
|
-
return /* @__PURE__ */ jsx(
|
|
31761
|
-
"div",
|
|
31762
|
-
{
|
|
31763
|
-
"data-slot": "card-content",
|
|
31764
|
-
className: cn$1("px-6", className),
|
|
31765
|
-
...props2
|
|
31766
|
-
}
|
|
31767
|
-
);
|
|
31768
|
-
}
|
|
31769
|
-
function CardFooter({ className, ...props2 }) {
|
|
31770
|
-
return /* @__PURE__ */ jsx(
|
|
31771
|
-
"div",
|
|
31772
|
-
{
|
|
31773
|
-
"data-slot": "card-footer",
|
|
31774
|
-
className: cn$1("flex items-center px-6 [.border-t]:pt-6", className),
|
|
31775
|
-
...props2
|
|
31776
|
-
}
|
|
31777
|
-
);
|
|
31778
|
-
}
|
|
31779
32341
|
function ObjectField({ field, control, fieldPath }) {
|
|
31780
32342
|
if (!field.fields) return null;
|
|
31781
32343
|
return /* @__PURE__ */ jsxs(Card, { className: cn$1(field.className), children: [
|
|
@@ -32196,622 +32758,138 @@ function FormBuilderField({ field, control, onChange, parentPath }) {
|
|
|
32196
32758
|
value: controllerField.value,
|
|
32197
32759
|
onChange: handleChange,
|
|
32198
32760
|
className: baseClassName
|
|
32199
|
-
}
|
|
32200
|
-
);
|
|
32201
|
-
default:
|
|
32202
|
-
return /* @__PURE__ */ jsx(
|
|
32203
|
-
TextField,
|
|
32204
|
-
{
|
|
32205
|
-
field,
|
|
32206
|
-
control,
|
|
32207
|
-
fieldPath,
|
|
32208
|
-
value: controllerField.value,
|
|
32209
|
-
onChange: handleChange,
|
|
32210
|
-
className: baseClassName
|
|
32211
|
-
}
|
|
32212
|
-
);
|
|
32213
|
-
}
|
|
32214
|
-
};
|
|
32215
|
-
if (field.type === "checkbox" || field.type === "switch") {
|
|
32216
|
-
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32217
|
-
renderField(),
|
|
32218
|
-
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32219
|
-
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32220
|
-
] });
|
|
32221
|
-
}
|
|
32222
|
-
const placement = field.labelPlacement ?? "stacked";
|
|
32223
|
-
if (placement === "hidden" || field.type === "array") {
|
|
32224
|
-
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32225
|
-
renderField(),
|
|
32226
|
-
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32227
|
-
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32228
|
-
] });
|
|
32229
|
-
}
|
|
32230
|
-
if (placement === "inline") {
|
|
32231
|
-
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-1", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32232
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
32233
|
-
/* @__PURE__ */ jsxs(Label$2, { htmlFor: fieldPath, className: "text-sm font-medium", children: [
|
|
32234
|
-
field.label,
|
|
32235
|
-
field.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
32236
|
-
] }),
|
|
32237
|
-
renderField()
|
|
32238
|
-
] }),
|
|
32239
|
-
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32240
|
-
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32241
|
-
] });
|
|
32242
|
-
}
|
|
32243
|
-
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32244
|
-
/* @__PURE__ */ jsxs(Label$2, { htmlFor: fieldPath, className: "text-sm font-medium", children: [
|
|
32245
|
-
field.label,
|
|
32246
|
-
field.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
32247
|
-
] }),
|
|
32248
|
-
renderField(),
|
|
32249
|
-
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32250
|
-
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32251
|
-
] });
|
|
32252
|
-
}
|
|
32253
|
-
var NAME$2 = "Separator";
|
|
32254
|
-
var DEFAULT_ORIENTATION = "horizontal";
|
|
32255
|
-
var ORIENTATIONS = ["horizontal", "vertical"];
|
|
32256
|
-
var Separator$2 = React.forwardRef((props2, forwardedRef) => {
|
|
32257
|
-
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props2;
|
|
32258
|
-
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
32259
|
-
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
32260
|
-
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
32261
|
-
return /* @__PURE__ */ jsx(
|
|
32262
|
-
Primitive.div,
|
|
32263
|
-
{
|
|
32264
|
-
"data-orientation": orientation,
|
|
32265
|
-
...semanticProps,
|
|
32266
|
-
...domProps,
|
|
32267
|
-
ref: forwardedRef
|
|
32268
|
-
}
|
|
32269
|
-
);
|
|
32270
|
-
});
|
|
32271
|
-
Separator$2.displayName = NAME$2;
|
|
32272
|
-
function isValidOrientation(orientation) {
|
|
32273
|
-
return ORIENTATIONS.includes(orientation);
|
|
32274
|
-
}
|
|
32275
|
-
var Root$6 = Separator$2;
|
|
32276
|
-
function Separator$1({
|
|
32277
|
-
className,
|
|
32278
|
-
orientation = "horizontal",
|
|
32279
|
-
decorative = true,
|
|
32280
|
-
...props2
|
|
32281
|
-
}) {
|
|
32282
|
-
return /* @__PURE__ */ jsx(
|
|
32283
|
-
Root$6,
|
|
32284
|
-
{
|
|
32285
|
-
"data-slot": "separator",
|
|
32286
|
-
decorative,
|
|
32287
|
-
orientation,
|
|
32288
|
-
className: cn$1(
|
|
32289
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
32290
|
-
className
|
|
32291
|
-
),
|
|
32292
|
-
...props2
|
|
32293
|
-
}
|
|
32294
|
-
);
|
|
32295
|
-
}
|
|
32296
|
-
var TABS_NAME = "Tabs";
|
|
32297
|
-
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
32298
|
-
createRovingFocusGroupScope
|
|
32299
|
-
]);
|
|
32300
|
-
var useRovingFocusGroupScope$3 = createRovingFocusGroupScope();
|
|
32301
|
-
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
32302
|
-
var Tabs$1 = React.forwardRef(
|
|
32303
|
-
(props2, forwardedRef) => {
|
|
32304
|
-
const {
|
|
32305
|
-
__scopeTabs,
|
|
32306
|
-
value: valueProp,
|
|
32307
|
-
onValueChange,
|
|
32308
|
-
defaultValue,
|
|
32309
|
-
orientation = "horizontal",
|
|
32310
|
-
dir,
|
|
32311
|
-
activationMode = "automatic",
|
|
32312
|
-
...tabsProps
|
|
32313
|
-
} = props2;
|
|
32314
|
-
const direction = useDirection(dir);
|
|
32315
|
-
const [value, setValue] = useControllableState$1({
|
|
32316
|
-
prop: valueProp,
|
|
32317
|
-
onChange: onValueChange,
|
|
32318
|
-
defaultProp: defaultValue ?? "",
|
|
32319
|
-
caller: TABS_NAME
|
|
32320
|
-
});
|
|
32321
|
-
return /* @__PURE__ */ jsx(
|
|
32322
|
-
TabsProvider,
|
|
32323
|
-
{
|
|
32324
|
-
scope: __scopeTabs,
|
|
32325
|
-
baseId: useId$1(),
|
|
32326
|
-
value,
|
|
32327
|
-
onValueChange: setValue,
|
|
32328
|
-
orientation,
|
|
32329
|
-
dir: direction,
|
|
32330
|
-
activationMode,
|
|
32331
|
-
children: /* @__PURE__ */ jsx(
|
|
32332
|
-
Primitive.div,
|
|
32333
|
-
{
|
|
32334
|
-
dir: direction,
|
|
32335
|
-
"data-orientation": orientation,
|
|
32336
|
-
...tabsProps,
|
|
32337
|
-
ref: forwardedRef
|
|
32338
|
-
}
|
|
32339
|
-
)
|
|
32340
|
-
}
|
|
32341
|
-
);
|
|
32342
|
-
}
|
|
32343
|
-
);
|
|
32344
|
-
Tabs$1.displayName = TABS_NAME;
|
|
32345
|
-
var TAB_LIST_NAME = "TabsList";
|
|
32346
|
-
var TabsList$1 = React.forwardRef(
|
|
32347
|
-
(props2, forwardedRef) => {
|
|
32348
|
-
const { __scopeTabs, loop = true, ...listProps } = props2;
|
|
32349
|
-
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
32350
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope$3(__scopeTabs);
|
|
32351
|
-
return /* @__PURE__ */ jsx(
|
|
32352
|
-
Root$9,
|
|
32353
|
-
{
|
|
32354
|
-
asChild: true,
|
|
32355
|
-
...rovingFocusGroupScope,
|
|
32356
|
-
orientation: context.orientation,
|
|
32357
|
-
dir: context.dir,
|
|
32358
|
-
loop,
|
|
32359
|
-
children: /* @__PURE__ */ jsx(
|
|
32360
|
-
Primitive.div,
|
|
32361
|
-
{
|
|
32362
|
-
role: "tablist",
|
|
32363
|
-
"aria-orientation": context.orientation,
|
|
32364
|
-
...listProps,
|
|
32365
|
-
ref: forwardedRef
|
|
32366
|
-
}
|
|
32367
|
-
)
|
|
32368
|
-
}
|
|
32369
|
-
);
|
|
32370
|
-
}
|
|
32371
|
-
);
|
|
32372
|
-
TabsList$1.displayName = TAB_LIST_NAME;
|
|
32373
|
-
var TRIGGER_NAME$6 = "TabsTrigger";
|
|
32374
|
-
var TabsTrigger$1 = React.forwardRef(
|
|
32375
|
-
(props2, forwardedRef) => {
|
|
32376
|
-
const { __scopeTabs, value, disabled = false, ...triggerProps } = props2;
|
|
32377
|
-
const context = useTabsContext(TRIGGER_NAME$6, __scopeTabs);
|
|
32378
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope$3(__scopeTabs);
|
|
32379
|
-
const triggerId = makeTriggerId$1(context.baseId, value);
|
|
32380
|
-
const contentId = makeContentId$1(context.baseId, value);
|
|
32381
|
-
const isSelected = value === context.value;
|
|
32382
|
-
return /* @__PURE__ */ jsx(
|
|
32383
|
-
Item$1,
|
|
32384
|
-
{
|
|
32385
|
-
asChild: true,
|
|
32386
|
-
...rovingFocusGroupScope,
|
|
32387
|
-
focusable: !disabled,
|
|
32388
|
-
active: isSelected,
|
|
32389
|
-
children: /* @__PURE__ */ jsx(
|
|
32390
|
-
Primitive.button,
|
|
32761
|
+
}
|
|
32762
|
+
);
|
|
32763
|
+
default:
|
|
32764
|
+
return /* @__PURE__ */ jsx(
|
|
32765
|
+
TextField,
|
|
32391
32766
|
{
|
|
32392
|
-
|
|
32393
|
-
|
|
32394
|
-
|
|
32395
|
-
|
|
32396
|
-
|
|
32397
|
-
|
|
32398
|
-
disabled,
|
|
32399
|
-
id: triggerId,
|
|
32400
|
-
...triggerProps,
|
|
32401
|
-
ref: forwardedRef,
|
|
32402
|
-
onMouseDown: composeEventHandlers$1(props2.onMouseDown, (event) => {
|
|
32403
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
32404
|
-
context.onValueChange(value);
|
|
32405
|
-
} else {
|
|
32406
|
-
event.preventDefault();
|
|
32407
|
-
}
|
|
32408
|
-
}),
|
|
32409
|
-
onKeyDown: composeEventHandlers$1(props2.onKeyDown, (event) => {
|
|
32410
|
-
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
32411
|
-
}),
|
|
32412
|
-
onFocus: composeEventHandlers$1(props2.onFocus, () => {
|
|
32413
|
-
const isAutomaticActivation = context.activationMode !== "manual";
|
|
32414
|
-
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
32415
|
-
context.onValueChange(value);
|
|
32416
|
-
}
|
|
32417
|
-
})
|
|
32767
|
+
field,
|
|
32768
|
+
control,
|
|
32769
|
+
fieldPath,
|
|
32770
|
+
value: controllerField.value,
|
|
32771
|
+
onChange: handleChange,
|
|
32772
|
+
className: baseClassName
|
|
32418
32773
|
}
|
|
32419
|
-
)
|
|
32420
|
-
}
|
|
32421
|
-
);
|
|
32422
|
-
}
|
|
32423
|
-
);
|
|
32424
|
-
TabsTrigger$1.displayName = TRIGGER_NAME$6;
|
|
32425
|
-
var CONTENT_NAME$7 = "TabsContent";
|
|
32426
|
-
var TabsContent$1 = React.forwardRef(
|
|
32427
|
-
(props2, forwardedRef) => {
|
|
32428
|
-
const { __scopeTabs, value, forceMount, children, ...contentProps } = props2;
|
|
32429
|
-
const context = useTabsContext(CONTENT_NAME$7, __scopeTabs);
|
|
32430
|
-
const triggerId = makeTriggerId$1(context.baseId, value);
|
|
32431
|
-
const contentId = makeContentId$1(context.baseId, value);
|
|
32432
|
-
const isSelected = value === context.value;
|
|
32433
|
-
const isMountAnimationPreventedRef = React.useRef(isSelected);
|
|
32434
|
-
React.useEffect(() => {
|
|
32435
|
-
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
32436
|
-
return () => cancelAnimationFrame(rAF);
|
|
32437
|
-
}, []);
|
|
32438
|
-
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(
|
|
32439
|
-
Primitive.div,
|
|
32440
|
-
{
|
|
32441
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
32442
|
-
"data-orientation": context.orientation,
|
|
32443
|
-
role: "tabpanel",
|
|
32444
|
-
"aria-labelledby": triggerId,
|
|
32445
|
-
hidden: !present,
|
|
32446
|
-
id: contentId,
|
|
32447
|
-
tabIndex: 0,
|
|
32448
|
-
...contentProps,
|
|
32449
|
-
ref: forwardedRef,
|
|
32450
|
-
style: {
|
|
32451
|
-
...props2.style,
|
|
32452
|
-
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
32453
|
-
},
|
|
32454
|
-
children: present && children
|
|
32455
|
-
}
|
|
32456
|
-
) });
|
|
32457
|
-
}
|
|
32458
|
-
);
|
|
32459
|
-
TabsContent$1.displayName = CONTENT_NAME$7;
|
|
32460
|
-
function makeTriggerId$1(baseId, value) {
|
|
32461
|
-
return `${baseId}-trigger-${value}`;
|
|
32462
|
-
}
|
|
32463
|
-
function makeContentId$1(baseId, value) {
|
|
32464
|
-
return `${baseId}-content-${value}`;
|
|
32465
|
-
}
|
|
32466
|
-
var Root2$6 = Tabs$1;
|
|
32467
|
-
var List$1 = TabsList$1;
|
|
32468
|
-
var Trigger$5 = TabsTrigger$1;
|
|
32469
|
-
var Content$2 = TabsContent$1;
|
|
32470
|
-
function Tabs({
|
|
32471
|
-
className,
|
|
32472
|
-
...props2
|
|
32473
|
-
}) {
|
|
32474
|
-
return /* @__PURE__ */ jsx(
|
|
32475
|
-
Root2$6,
|
|
32476
|
-
{
|
|
32477
|
-
"data-slot": "tabs",
|
|
32478
|
-
className: cn$1("flex flex-col gap-2", className),
|
|
32479
|
-
...props2
|
|
32480
|
-
}
|
|
32481
|
-
);
|
|
32482
|
-
}
|
|
32483
|
-
function TabsList({
|
|
32484
|
-
className,
|
|
32485
|
-
...props2
|
|
32486
|
-
}) {
|
|
32487
|
-
return /* @__PURE__ */ jsx(
|
|
32488
|
-
List$1,
|
|
32489
|
-
{
|
|
32490
|
-
"data-slot": "tabs-list",
|
|
32491
|
-
className: cn$1(
|
|
32492
|
-
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
32493
|
-
className
|
|
32494
|
-
),
|
|
32495
|
-
...props2
|
|
32496
|
-
}
|
|
32497
|
-
);
|
|
32498
|
-
}
|
|
32499
|
-
function TabsTrigger({
|
|
32500
|
-
className,
|
|
32501
|
-
...props2
|
|
32502
|
-
}) {
|
|
32503
|
-
return /* @__PURE__ */ jsx(
|
|
32504
|
-
Trigger$5,
|
|
32505
|
-
{
|
|
32506
|
-
"data-slot": "tabs-trigger",
|
|
32507
|
-
className: cn$1(
|
|
32508
|
-
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
32509
|
-
className
|
|
32510
|
-
),
|
|
32511
|
-
...props2
|
|
32512
|
-
}
|
|
32513
|
-
);
|
|
32514
|
-
}
|
|
32515
|
-
function TabsContent({
|
|
32516
|
-
className,
|
|
32517
|
-
...props2
|
|
32518
|
-
}) {
|
|
32519
|
-
return /* @__PURE__ */ jsx(
|
|
32520
|
-
Content$2,
|
|
32521
|
-
{
|
|
32522
|
-
"data-slot": "tabs-content",
|
|
32523
|
-
className: cn$1("flex-1 outline-none", className),
|
|
32524
|
-
...props2
|
|
32774
|
+
);
|
|
32525
32775
|
}
|
|
32526
|
-
|
|
32527
|
-
|
|
32528
|
-
|
|
32529
|
-
|
|
32530
|
-
|
|
32531
|
-
|
|
32532
|
-
|
|
32533
|
-
4: "grid-cols-4",
|
|
32534
|
-
5: "grid-cols-5",
|
|
32535
|
-
6: "grid-cols-6",
|
|
32536
|
-
7: "grid-cols-7",
|
|
32537
|
-
8: "grid-cols-8",
|
|
32538
|
-
9: "grid-cols-9",
|
|
32539
|
-
10: "grid-cols-10",
|
|
32540
|
-
11: "grid-cols-11",
|
|
32541
|
-
12: "grid-cols-12"
|
|
32542
|
-
},
|
|
32543
|
-
sm: {
|
|
32544
|
-
1: "sm:grid-cols-1",
|
|
32545
|
-
2: "sm:grid-cols-2",
|
|
32546
|
-
3: "sm:grid-cols-3",
|
|
32547
|
-
4: "sm:grid-cols-4",
|
|
32548
|
-
5: "sm:grid-cols-5",
|
|
32549
|
-
6: "sm:grid-cols-6",
|
|
32550
|
-
7: "sm:grid-cols-7",
|
|
32551
|
-
8: "sm:grid-cols-8",
|
|
32552
|
-
9: "sm:grid-cols-9",
|
|
32553
|
-
10: "sm:grid-cols-10",
|
|
32554
|
-
11: "sm:grid-cols-11",
|
|
32555
|
-
12: "sm:grid-cols-12"
|
|
32556
|
-
},
|
|
32557
|
-
md: {
|
|
32558
|
-
1: "md:grid-cols-1",
|
|
32559
|
-
2: "md:grid-cols-2",
|
|
32560
|
-
3: "md:grid-cols-3",
|
|
32561
|
-
4: "md:grid-cols-4",
|
|
32562
|
-
5: "md:grid-cols-5",
|
|
32563
|
-
6: "md:grid-cols-6",
|
|
32564
|
-
7: "md:grid-cols-7",
|
|
32565
|
-
8: "md:grid-cols-8",
|
|
32566
|
-
9: "md:grid-cols-9",
|
|
32567
|
-
10: "md:grid-cols-10",
|
|
32568
|
-
11: "md:grid-cols-11",
|
|
32569
|
-
12: "md:grid-cols-12"
|
|
32570
|
-
},
|
|
32571
|
-
lg: {
|
|
32572
|
-
1: "lg:grid-cols-1",
|
|
32573
|
-
2: "lg:grid-cols-2",
|
|
32574
|
-
3: "lg:grid-cols-3",
|
|
32575
|
-
4: "lg:grid-cols-4",
|
|
32576
|
-
5: "lg:grid-cols-5",
|
|
32577
|
-
6: "lg:grid-cols-6",
|
|
32578
|
-
7: "lg:grid-cols-7",
|
|
32579
|
-
8: "lg:grid-cols-8",
|
|
32580
|
-
9: "lg:grid-cols-9",
|
|
32581
|
-
10: "lg:grid-cols-10",
|
|
32582
|
-
11: "lg:grid-cols-11",
|
|
32583
|
-
12: "lg:grid-cols-12"
|
|
32584
|
-
},
|
|
32585
|
-
xl: {
|
|
32586
|
-
1: "xl:grid-cols-1",
|
|
32587
|
-
2: "xl:grid-cols-2",
|
|
32588
|
-
3: "xl:grid-cols-3",
|
|
32589
|
-
4: "xl:grid-cols-4",
|
|
32590
|
-
5: "xl:grid-cols-5",
|
|
32591
|
-
6: "xl:grid-cols-6",
|
|
32592
|
-
7: "xl:grid-cols-7",
|
|
32593
|
-
8: "xl:grid-cols-8",
|
|
32594
|
-
9: "xl:grid-cols-9",
|
|
32595
|
-
10: "xl:grid-cols-10",
|
|
32596
|
-
11: "xl:grid-cols-11",
|
|
32597
|
-
12: "xl:grid-cols-12"
|
|
32776
|
+
};
|
|
32777
|
+
if (field.type === "checkbox" || field.type === "switch") {
|
|
32778
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32779
|
+
renderField(),
|
|
32780
|
+
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32781
|
+
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32782
|
+
] });
|
|
32598
32783
|
}
|
|
32599
|
-
|
|
32600
|
-
|
|
32601
|
-
|
|
32602
|
-
|
|
32603
|
-
|
|
32604
|
-
|
|
32605
|
-
|
|
32606
|
-
5: "col-span-5",
|
|
32607
|
-
6: "col-span-6",
|
|
32608
|
-
7: "col-span-7",
|
|
32609
|
-
8: "col-span-8",
|
|
32610
|
-
9: "col-span-9",
|
|
32611
|
-
10: "col-span-10",
|
|
32612
|
-
11: "col-span-11",
|
|
32613
|
-
12: "col-span-12"
|
|
32614
|
-
},
|
|
32615
|
-
sm: {
|
|
32616
|
-
1: "sm:col-span-1",
|
|
32617
|
-
2: "sm:col-span-2",
|
|
32618
|
-
3: "sm:col-span-3",
|
|
32619
|
-
4: "sm:col-span-4",
|
|
32620
|
-
5: "sm:col-span-5",
|
|
32621
|
-
6: "sm:col-span-6",
|
|
32622
|
-
7: "sm:col-span-7",
|
|
32623
|
-
8: "sm:col-span-8",
|
|
32624
|
-
9: "sm:col-span-9",
|
|
32625
|
-
10: "sm:col-span-10",
|
|
32626
|
-
11: "sm:col-span-11",
|
|
32627
|
-
12: "sm:col-span-12"
|
|
32628
|
-
},
|
|
32629
|
-
md: {
|
|
32630
|
-
1: "md:col-span-1",
|
|
32631
|
-
2: "md:col-span-2",
|
|
32632
|
-
3: "md:col-span-3",
|
|
32633
|
-
4: "md:col-span-4",
|
|
32634
|
-
5: "md:col-span-5",
|
|
32635
|
-
6: "md:col-span-6",
|
|
32636
|
-
7: "md:col-span-7",
|
|
32637
|
-
8: "md:col-span-8",
|
|
32638
|
-
9: "md:col-span-9",
|
|
32639
|
-
10: "md:col-span-10",
|
|
32640
|
-
11: "md:col-span-11",
|
|
32641
|
-
12: "md:col-span-12"
|
|
32642
|
-
},
|
|
32643
|
-
lg: {
|
|
32644
|
-
1: "lg:col-span-1",
|
|
32645
|
-
2: "lg:col-span-2",
|
|
32646
|
-
3: "lg:col-span-3",
|
|
32647
|
-
4: "lg:col-span-4",
|
|
32648
|
-
5: "lg:col-span-5",
|
|
32649
|
-
6: "lg:col-span-6",
|
|
32650
|
-
7: "lg:col-span-7",
|
|
32651
|
-
8: "lg:col-span-8",
|
|
32652
|
-
9: "lg:col-span-9",
|
|
32653
|
-
10: "lg:col-span-10",
|
|
32654
|
-
11: "lg:col-span-11",
|
|
32655
|
-
12: "lg:col-span-12"
|
|
32656
|
-
},
|
|
32657
|
-
xl: {
|
|
32658
|
-
1: "xl:col-span-1",
|
|
32659
|
-
2: "xl:col-span-2",
|
|
32660
|
-
3: "xl:col-span-3",
|
|
32661
|
-
4: "xl:col-span-4",
|
|
32662
|
-
5: "xl:col-span-5",
|
|
32663
|
-
6: "xl:col-span-6",
|
|
32664
|
-
7: "xl:col-span-7",
|
|
32665
|
-
8: "xl:col-span-8",
|
|
32666
|
-
9: "xl:col-span-9",
|
|
32667
|
-
10: "xl:col-span-10",
|
|
32668
|
-
11: "xl:col-span-11",
|
|
32669
|
-
12: "xl:col-span-12"
|
|
32784
|
+
const placement = field.labelPlacement ?? "stacked";
|
|
32785
|
+
if (placement === "hidden" || field.type === "array") {
|
|
32786
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32787
|
+
renderField(),
|
|
32788
|
+
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32789
|
+
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32790
|
+
] });
|
|
32670
32791
|
}
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
|
|
32676
|
-
|
|
32677
|
-
|
|
32678
|
-
|
|
32679
|
-
|
|
32680
|
-
|
|
32681
|
-
|
|
32682
|
-
sm ? GRID_COLS.sm[sm] : void 0,
|
|
32683
|
-
md ? GRID_COLS.md[md] : void 0,
|
|
32684
|
-
lg ? GRID_COLS.lg[lg] : void 0,
|
|
32685
|
-
xl ? GRID_COLS.xl[xl] : void 0,
|
|
32686
|
-
gap
|
|
32687
|
-
);
|
|
32688
|
-
}
|
|
32689
|
-
function flexClasses(options) {
|
|
32690
|
-
const direction = (options == null ? void 0 : options.direction) ?? "col";
|
|
32691
|
-
const wrap = (options == null ? void 0 : options.wrap) ? "flex-wrap" : "flex-nowrap";
|
|
32692
|
-
const gap = (options == null ? void 0 : options.gap) ?? "gap-4";
|
|
32693
|
-
const align = (options == null ? void 0 : options.align) ?? "stretch";
|
|
32694
|
-
const justify = (options == null ? void 0 : options.justify) ?? "start";
|
|
32695
|
-
const alignClass = align === "start" ? "items-start" : align === "center" ? "items-center" : align === "end" ? "items-end" : "items-stretch";
|
|
32696
|
-
const justifyClass = justify === "start" ? "justify-start" : justify === "center" ? "justify-center" : justify === "between" ? "justify-between" : "justify-end";
|
|
32697
|
-
return cn$1("flex", `flex-${direction}`, wrap, gap, alignClass, justifyClass);
|
|
32698
|
-
}
|
|
32699
|
-
function leafSpanClasses(leaf) {
|
|
32700
|
-
if (!leaf.span) return void 0;
|
|
32701
|
-
const parts = [];
|
|
32702
|
-
if (leaf.span.base) parts.push(COL_SPAN.base[leaf.span.base]);
|
|
32703
|
-
if (leaf.span.sm) parts.push(COL_SPAN.sm[leaf.span.sm]);
|
|
32704
|
-
if (leaf.span.md) parts.push(COL_SPAN.md[leaf.span.md]);
|
|
32705
|
-
if (leaf.span.lg) parts.push(COL_SPAN.lg[leaf.span.lg]);
|
|
32706
|
-
if (leaf.span.xl) parts.push(COL_SPAN.xl[leaf.span.xl]);
|
|
32707
|
-
return parts.join(" ");
|
|
32708
|
-
}
|
|
32709
|
-
function isLeaf(child) {
|
|
32710
|
-
return child.content !== void 0;
|
|
32711
|
-
}
|
|
32712
|
-
function shallowEqualSpan(a2, b2) {
|
|
32713
|
-
if (a2 === b2) return true;
|
|
32714
|
-
if (!a2 || !b2) return !a2 && !b2;
|
|
32715
|
-
return a2.base === b2.base && a2.sm === b2.sm && a2.md === b2.md && a2.lg === b2.lg && a2.xl === b2.xl;
|
|
32716
|
-
}
|
|
32717
|
-
function shallowEqualLeaf(a2, b2) {
|
|
32718
|
-
const renderKeyEqual = (a2.renderKey ?? null) === (b2.renderKey ?? null);
|
|
32719
|
-
return a2.key === b2.key && a2.hidden === b2.hidden && a2.className === b2.className && a2.labelLayout === b2.labelLayout && a2.labelClassName === b2.labelClassName && a2.valueClassName === b2.valueClassName && a2.inlineLabelWidthClass === b2.inlineLabelWidthClass && shallowEqualSpan(a2.span, b2.span) && renderKeyEqual;
|
|
32720
|
-
}
|
|
32721
|
-
const SectionLeafRenderer = memo$1(
|
|
32722
|
-
function SectionLeafRenderer2({ leaf, renderLeaf }) {
|
|
32723
|
-
if (leaf.hidden) return null;
|
|
32724
|
-
const span = leafSpanClasses(leaf);
|
|
32725
|
-
if (renderLeaf) {
|
|
32726
|
-
return /* @__PURE__ */ jsx("div", { className: cn$1(span, leaf.className), children: renderLeaf(leaf) });
|
|
32727
|
-
}
|
|
32728
|
-
const hasLabel = leaf.label !== void 0 && leaf.label !== null && leaf.label !== "";
|
|
32729
|
-
const layout = leaf.labelLayout ?? "stacked";
|
|
32730
|
-
const labelBaseCls = "text-xs text-muted-foreground";
|
|
32731
|
-
const valueBaseCls = "text-sm leading-6";
|
|
32732
|
-
if (!hasLabel) {
|
|
32733
|
-
return /* @__PURE__ */ jsx("div", { className: cn$1(span, leaf.className, leaf.valueClassName), children: leaf.content });
|
|
32734
|
-
}
|
|
32735
|
-
if (layout === "inline") {
|
|
32736
|
-
const labelWidth = leaf.inlineLabelWidthClass ?? "w-32";
|
|
32737
|
-
return /* @__PURE__ */ jsxs("div", { className: cn$1(span, leaf.className, "flex items-start gap-4"), children: [
|
|
32738
|
-
/* @__PURE__ */ jsx("div", { className: cn$1(labelWidth, labelBaseCls, leaf.labelClassName), children: leaf.label }),
|
|
32739
|
-
/* @__PURE__ */ jsxs("div", { className: cn$1("flex-1", valueBaseCls, leaf.valueClassName), children: [
|
|
32740
|
-
leaf.content,
|
|
32741
|
-
leaf.description ? /* @__PURE__ */ jsx("div", { className: cn$1("mt-1", labelBaseCls), children: leaf.description }) : null
|
|
32742
|
-
] })
|
|
32743
|
-
] });
|
|
32744
|
-
}
|
|
32745
|
-
return /* @__PURE__ */ jsxs("div", { className: cn$1(span, leaf.className, "flex flex-col"), children: [
|
|
32746
|
-
/* @__PURE__ */ jsx("div", { className: cn$1(labelBaseCls, leaf.labelClassName), children: leaf.label }),
|
|
32747
|
-
/* @__PURE__ */ jsx("div", { className: cn$1(valueBaseCls, leaf.valueClassName), children: leaf.content }),
|
|
32748
|
-
leaf.description ? /* @__PURE__ */ jsx("div", { className: cn$1("mt-1", labelBaseCls), children: leaf.description }) : null
|
|
32792
|
+
if (placement === "inline") {
|
|
32793
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-1", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32794
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
32795
|
+
/* @__PURE__ */ jsxs(Label$2, { htmlFor: fieldPath, className: "text-sm font-medium", children: [
|
|
32796
|
+
field.label,
|
|
32797
|
+
field.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
32798
|
+
] }),
|
|
32799
|
+
renderField()
|
|
32800
|
+
] }),
|
|
32801
|
+
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32802
|
+
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32749
32803
|
] });
|
|
32750
|
-
}
|
|
32751
|
-
(
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32758
|
-
|
|
32759
|
-
|
|
32760
|
-
|
|
32761
|
-
|
|
32762
|
-
|
|
32763
|
-
|
|
32764
|
-
|
|
32765
|
-
|
|
32766
|
-
|
|
32767
|
-
|
|
32768
|
-
|
|
32769
|
-
|
|
32770
|
-
|
|
32804
|
+
}
|
|
32805
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", field.gridCols && `md:col-span-${field.gridCols}`), children: [
|
|
32806
|
+
/* @__PURE__ */ jsxs(Label$2, { htmlFor: fieldPath, className: "text-sm font-medium", children: [
|
|
32807
|
+
field.label,
|
|
32808
|
+
field.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
32809
|
+
] }),
|
|
32810
|
+
renderField(),
|
|
32811
|
+
field.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: field.description }),
|
|
32812
|
+
error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error.message })
|
|
32813
|
+
] });
|
|
32814
|
+
}
|
|
32815
|
+
function buildSectionNodes(options) {
|
|
32816
|
+
const {
|
|
32817
|
+
sections,
|
|
32818
|
+
control,
|
|
32819
|
+
handleFieldDependencies,
|
|
32820
|
+
handleFieldChange,
|
|
32821
|
+
onFieldChange,
|
|
32822
|
+
getValues
|
|
32823
|
+
} = options;
|
|
32824
|
+
const buildLeavesFromFields = (fields) => (fields ?? []).map((field) => {
|
|
32825
|
+
const fieldState = handleFieldDependencies(field);
|
|
32826
|
+
if (field.hidden || fieldState.hidden) return null;
|
|
32827
|
+
const spanMd = Math.max(1, Math.min(12, field.gridCols ?? 1));
|
|
32828
|
+
return {
|
|
32829
|
+
key: field.name,
|
|
32830
|
+
span: { base: 1, md: spanMd },
|
|
32831
|
+
className: field.wrapperClassName,
|
|
32832
|
+
hidden: field.hidden,
|
|
32833
|
+
content: /* @__PURE__ */ jsx(
|
|
32834
|
+
FormBuilderField,
|
|
32835
|
+
{
|
|
32836
|
+
field: {
|
|
32837
|
+
...field,
|
|
32838
|
+
disabled: field.disabled || fieldState.disabled
|
|
32839
|
+
},
|
|
32840
|
+
control,
|
|
32841
|
+
onChange: (value, ...extras) => {
|
|
32842
|
+
handleFieldChange(field, value, ...extras);
|
|
32843
|
+
onFieldChange == null ? void 0 : onFieldChange(field.name, value, getValues());
|
|
32844
|
+
},
|
|
32845
|
+
onFieldChange
|
|
32846
|
+
},
|
|
32847
|
+
field.name
|
|
32848
|
+
)
|
|
32771
32849
|
};
|
|
32772
|
-
|
|
32773
|
-
|
|
32774
|
-
|
|
32775
|
-
|
|
32776
|
-
|
|
32777
|
-
|
|
32778
|
-
|
|
32779
|
-
|
|
32780
|
-
|
|
32781
|
-
|
|
32782
|
-
|
|
32783
|
-
|
|
32784
|
-
|
|
32785
|
-
|
|
32786
|
-
|
|
32787
|
-
|
|
32788
|
-
|
|
32789
|
-
|
|
32790
|
-
|
|
32791
|
-
|
|
32792
|
-
|
|
32793
|
-
|
|
32794
|
-
|
|
32850
|
+
}).filter(Boolean);
|
|
32851
|
+
const buildSectionNode = (section, sectionIndex) => {
|
|
32852
|
+
var _a;
|
|
32853
|
+
const baseNode = {
|
|
32854
|
+
id: section.id ?? `section-${sectionIndex}`,
|
|
32855
|
+
title: section.title,
|
|
32856
|
+
subtitle: section.description,
|
|
32857
|
+
variant: section.variant ?? "plain",
|
|
32858
|
+
className: section.className,
|
|
32859
|
+
layout: section.layout ?? (section.tabs && section.tabs.length > 0 ? "tabs" : "grid"),
|
|
32860
|
+
grid: section.grid ?? { cols: 1, mdCols: 2, gap: "gap-4" },
|
|
32861
|
+
flex: section.flex,
|
|
32862
|
+
hidden: section.hidden
|
|
32863
|
+
};
|
|
32864
|
+
if (baseNode.layout === "tabs" && section.tabs && section.tabs.length > 0) {
|
|
32865
|
+
baseNode.defaultTabId = section.defaultTabId ?? ((_a = section.tabs[0]) == null ? void 0 : _a.id);
|
|
32866
|
+
baseNode.tabsListClassName = section.tabsListClassName;
|
|
32867
|
+
baseNode.tabsContentClassName = section.tabsContentClassName;
|
|
32868
|
+
baseNode.tabs = section.tabs.map((tab, _tabIdx) => {
|
|
32869
|
+
const nestedNodes = tab.sections.map((subSection, subIdx) => buildSectionNode(subSection, subIdx));
|
|
32870
|
+
const containerNode = {
|
|
32871
|
+
id: `${baseNode.id}-tab-${tab.id}`,
|
|
32872
|
+
variant: "plain",
|
|
32873
|
+
layout: "grid",
|
|
32874
|
+
grid: section.grid ?? { cols: 1, mdCols: 2, gap: "gap-4" },
|
|
32875
|
+
children: nestedNodes
|
|
32876
|
+
};
|
|
32877
|
+
return {
|
|
32878
|
+
id: tab.id,
|
|
32879
|
+
label: tab.label,
|
|
32880
|
+
className: tab.className,
|
|
32881
|
+
contentClassName: tab.contentClassName,
|
|
32882
|
+
node: containerNode
|
|
32883
|
+
};
|
|
32884
|
+
});
|
|
32885
|
+
return baseNode;
|
|
32795
32886
|
}
|
|
32887
|
+
baseNode.children = buildLeavesFromFields(section.fields);
|
|
32888
|
+
return baseNode;
|
|
32796
32889
|
};
|
|
32797
|
-
|
|
32798
|
-
const defaultTabId = node.defaultTabId ?? ((_a = node.tabs[0]) == null ? void 0 : _a.id);
|
|
32799
|
-
return /* @__PURE__ */ jsx(SectionContainer, { children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: defaultTabId, className: cn$1("space-y-2"), children: [
|
|
32800
|
-
/* @__PURE__ */ jsx(TabsList, { className: cn$1(node.tabsListClassName), children: node.tabs.map((tab) => /* @__PURE__ */ jsx(TabsTrigger, { value: tab.id, className: cn$1(tab.className), children: tab.label }, tab.id)) }),
|
|
32801
|
-
node.tabs.map((tab) => /* @__PURE__ */ jsx(TabsContent, { value: tab.id, className: cn$1(node.tabsContentClassName, tab.contentClassName), children: /* @__PURE__ */ jsx(SectionNodeRenderer, { node: tab.node, renderLeaf }) }, tab.id))
|
|
32802
|
-
] }) });
|
|
32803
|
-
}
|
|
32804
|
-
return /* @__PURE__ */ jsx(SectionContainer, { children: /* @__PURE__ */ jsx("div", { className: containerClass, children: (node.children ?? []).map((child) => {
|
|
32805
|
-
if (isLeaf(child)) {
|
|
32806
|
-
return /* @__PURE__ */ jsx(SectionLeafRenderer, { leaf: child, renderLeaf }, child.key);
|
|
32807
|
-
}
|
|
32808
|
-
if (child.hidden) return null;
|
|
32809
|
-
return /* @__PURE__ */ jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsx(SectionNodeRenderer, { node: child, renderLeaf }) }, child.id);
|
|
32810
|
-
}) }) });
|
|
32811
|
-
}
|
|
32812
|
-
function SectionBuilder({ sections, className, renderLeaf }) {
|
|
32813
|
-
return /* @__PURE__ */ jsx("div", { className: cn$1("space-y-6", className), children: sections.map((section) => /* @__PURE__ */ jsx(SectionNodeRenderer, { node: section, renderLeaf }, section.id)) });
|
|
32890
|
+
return sections.map((section, sectionIndex) => buildSectionNode(section, sectionIndex));
|
|
32814
32891
|
}
|
|
32892
|
+
const FormBuilderContext = createContext(null);
|
|
32815
32893
|
function FormBuilder({
|
|
32816
32894
|
sections,
|
|
32817
32895
|
schema,
|
|
@@ -32829,7 +32907,8 @@ function FormBuilder({
|
|
|
32829
32907
|
actionsClassName,
|
|
32830
32908
|
showActions = true,
|
|
32831
32909
|
customActions,
|
|
32832
|
-
showActionsSeparator = true
|
|
32910
|
+
showActionsSeparator = true,
|
|
32911
|
+
form
|
|
32833
32912
|
}) {
|
|
32834
32913
|
const generatedSchema = useMemo(() => {
|
|
32835
32914
|
if (schema) return schema;
|
|
@@ -33074,13 +33153,14 @@ function FormBuilder({
|
|
|
33074
33153
|
forEachSection(sections);
|
|
33075
33154
|
return values;
|
|
33076
33155
|
}, [sections, defaultValues]);
|
|
33077
|
-
const
|
|
33156
|
+
const internalForm = useForm({
|
|
33078
33157
|
// Dynamic schema shape: cast to any to satisfy resolver generics
|
|
33079
33158
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33080
33159
|
resolver: a$2(generatedSchema),
|
|
33081
33160
|
defaultValues: generatedDefaultValues
|
|
33082
33161
|
});
|
|
33083
|
-
const
|
|
33162
|
+
const activeForm = form ?? internalForm;
|
|
33163
|
+
const { control, handleSubmit, reset: reset2, setValue, getValues } = activeForm;
|
|
33084
33164
|
const dependencyFields = useMemo(() => {
|
|
33085
33165
|
const set2 = /* @__PURE__ */ new Set();
|
|
33086
33166
|
const forEachField = (secs) => {
|
|
@@ -33191,85 +33271,29 @@ function FormBuilder({
|
|
|
33191
33271
|
reset2(generatedDefaultValues);
|
|
33192
33272
|
onReset == null ? void 0 : onReset();
|
|
33193
33273
|
}, [reset2, generatedDefaultValues, onReset]);
|
|
33194
|
-
const sectionNodes = useMemo(
|
|
33195
|
-
|
|
33196
|
-
|
|
33197
|
-
|
|
33198
|
-
|
|
33199
|
-
|
|
33200
|
-
|
|
33201
|
-
|
|
33202
|
-
|
|
33203
|
-
|
|
33204
|
-
|
|
33205
|
-
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
|
-
|
|
33209
|
-
|
|
33210
|
-
|
|
33211
|
-
|
|
33212
|
-
|
|
33213
|
-
|
|
33214
|
-
|
|
33215
|
-
|
|
33216
|
-
|
|
33217
|
-
},
|
|
33218
|
-
field.name
|
|
33219
|
-
)
|
|
33220
|
-
};
|
|
33221
|
-
}).filter(Boolean);
|
|
33222
|
-
const buildSectionNode = (section, sectionIndex) => {
|
|
33223
|
-
var _a;
|
|
33224
|
-
const baseNode = {
|
|
33225
|
-
id: section.id ?? `section-${sectionIndex}`,
|
|
33226
|
-
title: section.title,
|
|
33227
|
-
subtitle: section.description,
|
|
33228
|
-
variant: section.variant ?? "plain",
|
|
33229
|
-
className: section.className,
|
|
33230
|
-
layout: section.layout ?? (section.tabs && section.tabs.length > 0 ? "tabs" : "grid"),
|
|
33231
|
-
grid: section.grid ?? { cols: 1, mdCols: 2, gap: "gap-4" },
|
|
33232
|
-
flex: section.flex,
|
|
33233
|
-
hidden: section.hidden
|
|
33234
|
-
};
|
|
33235
|
-
if (baseNode.layout === "tabs" && section.tabs && section.tabs.length > 0) {
|
|
33236
|
-
baseNode.defaultTabId = section.defaultTabId ?? ((_a = section.tabs[0]) == null ? void 0 : _a.id);
|
|
33237
|
-
baseNode.tabsListClassName = section.tabsListClassName;
|
|
33238
|
-
baseNode.tabsContentClassName = section.tabsContentClassName;
|
|
33239
|
-
baseNode.tabs = section.tabs.map((tab, _tabIdx) => {
|
|
33240
|
-
const nestedNodes = tab.sections.map((subSection, subIdx) => buildSectionNode(subSection, subIdx));
|
|
33241
|
-
const containerNode = {
|
|
33242
|
-
id: `${baseNode.id}-tab-${tab.id}`,
|
|
33243
|
-
title: void 0,
|
|
33244
|
-
subtitle: void 0,
|
|
33245
|
-
variant: "plain",
|
|
33246
|
-
layout: "grid",
|
|
33247
|
-
grid: section.grid ?? { cols: 1, mdCols: 2, gap: "gap-4" },
|
|
33248
|
-
children: nestedNodes
|
|
33249
|
-
};
|
|
33250
|
-
return {
|
|
33251
|
-
id: tab.id,
|
|
33252
|
-
label: tab.label,
|
|
33253
|
-
className: tab.className,
|
|
33254
|
-
contentClassName: tab.contentClassName,
|
|
33255
|
-
node: containerNode
|
|
33256
|
-
};
|
|
33257
|
-
});
|
|
33258
|
-
return baseNode;
|
|
33259
|
-
}
|
|
33260
|
-
baseNode.children = buildLeavesFromFields(section.fields);
|
|
33261
|
-
return baseNode;
|
|
33262
|
-
};
|
|
33263
|
-
return sections.map((section, sectionIndex) => buildSectionNode(section, sectionIndex));
|
|
33264
|
-
}, [
|
|
33265
|
-
sections,
|
|
33266
|
-
control,
|
|
33267
|
-
handleFieldDependencies,
|
|
33268
|
-
handleFieldChange,
|
|
33269
|
-
onFieldChange,
|
|
33270
|
-
getValues
|
|
33271
|
-
]);
|
|
33272
|
-
return /* @__PURE__ */ jsx("div", { className: cn$1("space-y-6", className), children: /* @__PURE__ */ jsxs(
|
|
33274
|
+
const sectionNodes = useMemo(
|
|
33275
|
+
() => buildSectionNodes({
|
|
33276
|
+
sections,
|
|
33277
|
+
control,
|
|
33278
|
+
handleFieldDependencies,
|
|
33279
|
+
handleFieldChange,
|
|
33280
|
+
onFieldChange,
|
|
33281
|
+
getValues
|
|
33282
|
+
}),
|
|
33283
|
+
[sections, control, handleFieldDependencies, handleFieldChange, onFieldChange, getValues]
|
|
33284
|
+
);
|
|
33285
|
+
const contextValue = useMemo(
|
|
33286
|
+
() => ({
|
|
33287
|
+
control,
|
|
33288
|
+
getValues,
|
|
33289
|
+
setValue,
|
|
33290
|
+
onFieldChange,
|
|
33291
|
+
handleFieldDependencies,
|
|
33292
|
+
handleFieldChange
|
|
33293
|
+
}),
|
|
33294
|
+
[control, getValues, setValue, onFieldChange, handleFieldDependencies, handleFieldChange]
|
|
33295
|
+
);
|
|
33296
|
+
return /* @__PURE__ */ jsx(FormBuilderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: cn$1("space-y-6", className), children: /* @__PURE__ */ jsxs(
|
|
33273
33297
|
"form",
|
|
33274
33298
|
{
|
|
33275
33299
|
onSubmit: handleSubmit(handleFormSubmit),
|
|
@@ -33321,7 +33345,7 @@ function FormBuilder({
|
|
|
33321
33345
|
)
|
|
33322
33346
|
]
|
|
33323
33347
|
}
|
|
33324
|
-
) });
|
|
33348
|
+
) }) });
|
|
33325
33349
|
}
|
|
33326
33350
|
const commonValidations = {
|
|
33327
33351
|
email: string().email("Please enter a valid email address"),
|
|
@@ -33782,7 +33806,7 @@ var Menu$1 = (props2) => {
|
|
|
33782
33806
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
33783
33807
|
};
|
|
33784
33808
|
}, []);
|
|
33785
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
33809
|
+
return /* @__PURE__ */ jsx(Root2$9, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
33786
33810
|
MenuProvider,
|
|
33787
33811
|
{
|
|
33788
33812
|
scope: __scopeMenu,
|
|
@@ -33990,7 +34014,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
33990
34014
|
onInteractOutside,
|
|
33991
34015
|
onDismiss,
|
|
33992
34016
|
children: /* @__PURE__ */ jsx(
|
|
33993
|
-
Root$
|
|
34017
|
+
Root$d,
|
|
33994
34018
|
{
|
|
33995
34019
|
asChild: true,
|
|
33996
34020
|
...rovingFocusGroupScope,
|
|
@@ -34004,7 +34028,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
34004
34028
|
}),
|
|
34005
34029
|
preventScrollOnEntryFocus: true,
|
|
34006
34030
|
children: /* @__PURE__ */ jsx(
|
|
34007
|
-
Content$
|
|
34031
|
+
Content$3,
|
|
34008
34032
|
{
|
|
34009
34033
|
role: "menu",
|
|
34010
34034
|
"aria-orientation": "vertical",
|
|
@@ -34153,7 +34177,7 @@ var MenuItemImpl = React.forwardRef(
|
|
|
34153
34177
|
scope: __scopeMenu,
|
|
34154
34178
|
disabled,
|
|
34155
34179
|
textValue: textValue ?? textContent,
|
|
34156
|
-
children: /* @__PURE__ */ jsx(Item$
|
|
34180
|
+
children: /* @__PURE__ */ jsx(Item$2, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
|
|
34157
34181
|
Primitive.div,
|
|
34158
34182
|
{
|
|
34159
34183
|
role: "menuitem",
|
|
@@ -34315,7 +34339,7 @@ var MenuSub = (props2) => {
|
|
|
34315
34339
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
34316
34340
|
return () => handleOpenChange(false);
|
|
34317
34341
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
34318
|
-
return /* @__PURE__ */ jsx(Root2$
|
|
34342
|
+
return /* @__PURE__ */ jsx(Root2$9, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
34319
34343
|
MenuProvider,
|
|
34320
34344
|
{
|
|
34321
34345
|
scope: __scopeMenu,
|
|
@@ -40854,7 +40878,7 @@ var useDialogScope = createDialogScope();
|
|
|
40854
40878
|
var AlertDialog$1 = (props2) => {
|
|
40855
40879
|
const { __scopeAlertDialog, ...alertDialogProps } = props2;
|
|
40856
40880
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
40857
|
-
return /* @__PURE__ */ jsx(Root$
|
|
40881
|
+
return /* @__PURE__ */ jsx(Root$a, { ...dialogScope, ...alertDialogProps, modal: true });
|
|
40858
40882
|
};
|
|
40859
40883
|
AlertDialog$1.displayName = ROOT_NAME;
|
|
40860
40884
|
var TRIGGER_NAME$4 = "AlertDialogTrigger";
|
|
@@ -40862,7 +40886,7 @@ var AlertDialogTrigger$1 = React.forwardRef(
|
|
|
40862
40886
|
(props2, forwardedRef) => {
|
|
40863
40887
|
const { __scopeAlertDialog, ...triggerProps } = props2;
|
|
40864
40888
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
40865
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
40889
|
+
return /* @__PURE__ */ jsx(Trigger$7, { ...dialogScope, ...triggerProps, ref: forwardedRef });
|
|
40866
40890
|
}
|
|
40867
40891
|
);
|
|
40868
40892
|
AlertDialogTrigger$1.displayName = TRIGGER_NAME$4;
|
|
@@ -40899,7 +40923,7 @@ var AlertDialogContent$1 = React.forwardRef(
|
|
|
40899
40923
|
titleName: TITLE_NAME,
|
|
40900
40924
|
docsSlug: "alert-dialog",
|
|
40901
40925
|
children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(
|
|
40902
|
-
Content$
|
|
40926
|
+
Content$2,
|
|
40903
40927
|
{
|
|
40904
40928
|
role: "alertdialog",
|
|
40905
40929
|
...dialogScope,
|
|
@@ -41452,12 +41476,12 @@ function useIsMobile() {
|
|
|
41452
41476
|
return !!isMobile;
|
|
41453
41477
|
}
|
|
41454
41478
|
function Sheet({ ...props2 }) {
|
|
41455
|
-
return /* @__PURE__ */ jsx(Root$
|
|
41479
|
+
return /* @__PURE__ */ jsx(Root$a, { "data-slot": "sheet", ...props2 });
|
|
41456
41480
|
}
|
|
41457
41481
|
function SheetTrigger({
|
|
41458
41482
|
...props2
|
|
41459
41483
|
}) {
|
|
41460
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
41484
|
+
return /* @__PURE__ */ jsx(Trigger$7, { "data-slot": "sheet-trigger", ...props2 });
|
|
41461
41485
|
}
|
|
41462
41486
|
function SheetClose({
|
|
41463
41487
|
...props2
|
|
@@ -41494,7 +41518,7 @@ function SheetContent({
|
|
|
41494
41518
|
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
41495
41519
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
41496
41520
|
/* @__PURE__ */ jsxs(
|
|
41497
|
-
Content$
|
|
41521
|
+
Content$2,
|
|
41498
41522
|
{
|
|
41499
41523
|
"data-slot": "sheet-content",
|
|
41500
41524
|
className: cn$1(
|
|
@@ -41845,7 +41869,7 @@ function SidebarSeparator({
|
|
|
41845
41869
|
...props2
|
|
41846
41870
|
}) {
|
|
41847
41871
|
return /* @__PURE__ */ jsx(
|
|
41848
|
-
Separator$
|
|
41872
|
+
Separator$2,
|
|
41849
41873
|
{
|
|
41850
41874
|
"data-slot": "sidebar-separator",
|
|
41851
41875
|
"data-sidebar": "separator",
|
|
@@ -42472,7 +42496,7 @@ function AdminLayoutContent({
|
|
|
42472
42496
|
/* @__PURE__ */ jsx(SidebarGroupLabel, { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider px-3 mb-2 group-data-[collapsible=icon]:hidden", children: group.label }),
|
|
42473
42497
|
/* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { className: "group-data-[collapsible=icon]:items-center", children: group.items.map((item) => renderItem(item, 0)) }) })
|
|
42474
42498
|
] }),
|
|
42475
|
-
idx < sidebarGroups.length - 1 && /* @__PURE__ */ jsx(Separator$
|
|
42499
|
+
idx < sidebarGroups.length - 1 && /* @__PURE__ */ jsx(Separator$2, { orientation: "horizontal", className: "bg-sidebar-border group-data-[collapsible=icon]:hidden" })
|
|
42476
42500
|
] }, group.id)) }),
|
|
42477
42501
|
/* @__PURE__ */ jsx(SidebarFooter, { className: "bg-sidebar border-t border-sidebar-border px-2 py-3", children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { className: "group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:w-full group-data-[collapsible=icon]:justify-center", children: /* @__PURE__ */ jsx(
|
|
42478
42502
|
SidebarMenuButton,
|
|
@@ -52518,7 +52542,7 @@ function Root$3({ open: openProp, onOpenChange, children, onDrag: onDragProp, on
|
|
|
52518
52542
|
}, [
|
|
52519
52543
|
modal
|
|
52520
52544
|
]);
|
|
52521
|
-
return /* @__PURE__ */ React__default.createElement(Root$
|
|
52545
|
+
return /* @__PURE__ */ React__default.createElement(Root$a, {
|
|
52522
52546
|
defaultOpen,
|
|
52523
52547
|
onOpenChange: (open) => {
|
|
52524
52548
|
if (!dismissible && !open) return;
|
|
@@ -52629,7 +52653,7 @@ const Content$1 = /* @__PURE__ */ React__default.forwardRef(function({ onPointer
|
|
|
52629
52653
|
wasBeyondThePointRef.current = false;
|
|
52630
52654
|
onRelease(event);
|
|
52631
52655
|
}
|
|
52632
|
-
return /* @__PURE__ */ React__default.createElement(Content$
|
|
52656
|
+
return /* @__PURE__ */ React__default.createElement(Content$2, {
|
|
52633
52657
|
"data-vaul-drawer-direction": direction,
|
|
52634
52658
|
"data-vaul-drawer": "",
|
|
52635
52659
|
"data-vaul-delayed-snap-points": delayedSnapPoints ? "true" : "false",
|
|
@@ -52792,7 +52816,7 @@ const Drawer$1 = {
|
|
|
52792
52816
|
Root: Root$3,
|
|
52793
52817
|
Content: Content$1,
|
|
52794
52818
|
Overlay,
|
|
52795
|
-
Trigger: Trigger$
|
|
52819
|
+
Trigger: Trigger$7,
|
|
52796
52820
|
Portal: Portal$1,
|
|
52797
52821
|
Close,
|
|
52798
52822
|
Title,
|
|
@@ -53067,7 +53091,7 @@ var HoverCard$1 = (props2) => {
|
|
|
53067
53091
|
onDismiss: handleDismiss,
|
|
53068
53092
|
hasSelectionRef,
|
|
53069
53093
|
isPointerDownOnContentRef,
|
|
53070
|
-
children: /* @__PURE__ */ jsx(Root2$
|
|
53094
|
+
children: /* @__PURE__ */ jsx(Root2$9, { ...popperScope, children })
|
|
53071
53095
|
}
|
|
53072
53096
|
);
|
|
53073
53097
|
};
|
|
@@ -53187,7 +53211,7 @@ var HoverCardContentImpl = React.forwardRef((props2, forwardedRef) => {
|
|
|
53187
53211
|
}),
|
|
53188
53212
|
onDismiss: context.onDismiss,
|
|
53189
53213
|
children: /* @__PURE__ */ jsx(
|
|
53190
|
-
Content$
|
|
53214
|
+
Content$3,
|
|
53191
53215
|
{
|
|
53192
53216
|
...popperScope,
|
|
53193
53217
|
...contentProps,
|
|
@@ -53576,7 +53600,7 @@ var Menubar$1 = React.forwardRef(
|
|
|
53576
53600
|
dir: direction,
|
|
53577
53601
|
loop,
|
|
53578
53602
|
children: /* @__PURE__ */ jsx(Collection$2.Provider, { scope: __scopeMenubar, children: /* @__PURE__ */ jsx(Collection$2.Slot, { scope: __scopeMenubar, children: /* @__PURE__ */ jsx(
|
|
53579
|
-
Root$
|
|
53603
|
+
Root$d,
|
|
53580
53604
|
{
|
|
53581
53605
|
asChild: true,
|
|
53582
53606
|
...rovingFocusGroupScope,
|
|
@@ -53646,7 +53670,7 @@ var MenubarTrigger$1 = React.forwardRef(
|
|
|
53646
53670
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
53647
53671
|
const open = context.value === menuContext.value;
|
|
53648
53672
|
return /* @__PURE__ */ jsx(Collection$2.ItemSlot, { scope: __scopeMenubar, value: menuContext.value, disabled, children: /* @__PURE__ */ jsx(
|
|
53649
|
-
Item$
|
|
53673
|
+
Item$2,
|
|
53650
53674
|
{
|
|
53651
53675
|
asChild: true,
|
|
53652
53676
|
...rovingFocusGroupScope,
|
|
@@ -54501,7 +54525,7 @@ var NavigationMenuTrigger$1 = React.forwardRef((props2, forwardedRef) => {
|
|
|
54501
54525
|
) }) }),
|
|
54502
54526
|
open && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54503
54527
|
/* @__PURE__ */ jsx(
|
|
54504
|
-
Root$
|
|
54528
|
+
Root$9,
|
|
54505
54529
|
{
|
|
54506
54530
|
"aria-hidden": true,
|
|
54507
54531
|
tabIndex: 0,
|
|
@@ -59924,7 +59948,7 @@ var ToggleGroupImpl = React__default.forwardRef(
|
|
|
59924
59948
|
const direction = useDirection(dir);
|
|
59925
59949
|
const commonProps = { role: "group", dir: direction, ...toggleGroupProps };
|
|
59926
59950
|
return /* @__PURE__ */ jsx(ToggleGroupContext$1, { scope: __scopeToggleGroup, rovingFocus, disabled, children: rovingFocus ? /* @__PURE__ */ jsx(
|
|
59927
|
-
Root$
|
|
59951
|
+
Root$d,
|
|
59928
59952
|
{
|
|
59929
59953
|
asChild: true,
|
|
59930
59954
|
...rovingFocusGroupScope,
|
|
@@ -59947,7 +59971,7 @@ var ToggleGroupItem$1 = React__default.forwardRef(
|
|
|
59947
59971
|
const commonProps = { ...props2, pressed, disabled };
|
|
59948
59972
|
const ref = React__default.useRef(null);
|
|
59949
59973
|
return context.rovingFocus ? /* @__PURE__ */ jsx(
|
|
59950
|
-
Item$
|
|
59974
|
+
Item$2,
|
|
59951
59975
|
{
|
|
59952
59976
|
asChild: true,
|
|
59953
59977
|
...rovingFocusGroupScope,
|
|
@@ -60273,7 +60297,7 @@ export {
|
|
|
60273
60297
|
SelectSeparator,
|
|
60274
60298
|
SelectTrigger,
|
|
60275
60299
|
SelectValue,
|
|
60276
|
-
Separator$
|
|
60300
|
+
Separator$2 as Separator,
|
|
60277
60301
|
Sheet,
|
|
60278
60302
|
SheetClose,
|
|
60279
60303
|
SheetContent,
|