@umami/react-zen 0.246.0 → 0.248.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +168 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +168 -123
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.css +25 -0
- package/styles.full.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -830,13 +830,14 @@ interface ComboBoxProps extends Omit<Combobox.Root.Props<string>, 'children' | '
|
|
|
830
830
|
label?: string;
|
|
831
831
|
placeholder?: string;
|
|
832
832
|
isDisabled?: boolean;
|
|
833
|
+
maxHeight?: string | number;
|
|
833
834
|
onChange?: (value: string | null) => void;
|
|
834
835
|
renderEmptyState?: (props: object) => ReactNode;
|
|
835
836
|
listProps?: ListProps;
|
|
836
837
|
popoverProps?: Combobox.Positioner.Props;
|
|
837
838
|
className?: string;
|
|
838
839
|
}
|
|
839
|
-
declare function ComboBox({ className, label, placeholder, isDisabled, onChange, renderEmptyState, listProps, popoverProps, children, items, itemToStringLabel, ...props }: ComboBoxProps): react_jsx_runtime.JSX.Element;
|
|
840
|
+
declare function ComboBox({ className, label, placeholder, isDisabled, maxHeight, onChange, renderEmptyState, listProps, popoverProps, children, items, itemToStringLabel, ...props }: ComboBoxProps): react_jsx_runtime.JSX.Element;
|
|
840
841
|
|
|
841
842
|
interface CommandProps extends ComponentProps<typeof Command$1> {
|
|
842
843
|
}
|
|
@@ -845,8 +846,9 @@ interface CommandInputProps extends ComponentProps<typeof Command$1.Input> {
|
|
|
845
846
|
}
|
|
846
847
|
declare function CommandInput({ className, ...props }: CommandInputProps): react_jsx_runtime.JSX.Element;
|
|
847
848
|
interface CommandListProps extends ComponentProps<typeof Command$1.List> {
|
|
849
|
+
maxHeight?: string | number;
|
|
848
850
|
}
|
|
849
|
-
declare function CommandList({ className, ...props }: CommandListProps): react_jsx_runtime.JSX.Element;
|
|
851
|
+
declare function CommandList({ maxHeight, className, ...props }: CommandListProps): react_jsx_runtime.JSX.Element;
|
|
850
852
|
interface CommandEmptyProps extends ComponentProps<typeof Command$1.Empty> {
|
|
851
853
|
}
|
|
852
854
|
declare function CommandEmpty({ className, ...props }: CommandEmptyProps): react_jsx_runtime.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -830,13 +830,14 @@ interface ComboBoxProps extends Omit<Combobox.Root.Props<string>, 'children' | '
|
|
|
830
830
|
label?: string;
|
|
831
831
|
placeholder?: string;
|
|
832
832
|
isDisabled?: boolean;
|
|
833
|
+
maxHeight?: string | number;
|
|
833
834
|
onChange?: (value: string | null) => void;
|
|
834
835
|
renderEmptyState?: (props: object) => ReactNode;
|
|
835
836
|
listProps?: ListProps;
|
|
836
837
|
popoverProps?: Combobox.Positioner.Props;
|
|
837
838
|
className?: string;
|
|
838
839
|
}
|
|
839
|
-
declare function ComboBox({ className, label, placeholder, isDisabled, onChange, renderEmptyState, listProps, popoverProps, children, items, itemToStringLabel, ...props }: ComboBoxProps): react_jsx_runtime.JSX.Element;
|
|
840
|
+
declare function ComboBox({ className, label, placeholder, isDisabled, maxHeight, onChange, renderEmptyState, listProps, popoverProps, children, items, itemToStringLabel, ...props }: ComboBoxProps): react_jsx_runtime.JSX.Element;
|
|
840
841
|
|
|
841
842
|
interface CommandProps extends ComponentProps<typeof Command$1> {
|
|
842
843
|
}
|
|
@@ -845,8 +846,9 @@ interface CommandInputProps extends ComponentProps<typeof Command$1.Input> {
|
|
|
845
846
|
}
|
|
846
847
|
declare function CommandInput({ className, ...props }: CommandInputProps): react_jsx_runtime.JSX.Element;
|
|
847
848
|
interface CommandListProps extends ComponentProps<typeof Command$1.List> {
|
|
849
|
+
maxHeight?: string | number;
|
|
848
850
|
}
|
|
849
|
-
declare function CommandList({ className, ...props }: CommandListProps): react_jsx_runtime.JSX.Element;
|
|
851
|
+
declare function CommandList({ maxHeight, className, ...props }: CommandListProps): react_jsx_runtime.JSX.Element;
|
|
850
852
|
interface CommandEmptyProps extends ComponentProps<typeof Command$1.Empty> {
|
|
851
853
|
}
|
|
852
854
|
declare function CommandEmpty({ className, ...props }: CommandEmptyProps): react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var checkboxGroup = require('@base-ui/react/checkbox-group');
|
|
|
22
22
|
var collapsible = require('@base-ui/react/collapsible');
|
|
23
23
|
var combobox = require('@base-ui/react/combobox');
|
|
24
24
|
var select = require('@base-ui/react/select');
|
|
25
|
+
var scrollArea = require('@base-ui/react/scroll-area');
|
|
25
26
|
var cmdk = require('cmdk');
|
|
26
27
|
var contextMenu = require('@base-ui/react/context-menu');
|
|
27
28
|
var reactHookForm = require('react-hook-form');
|
|
@@ -36,7 +37,6 @@ var progress = require('@base-ui/react/progress');
|
|
|
36
37
|
var radio = require('@base-ui/react/radio');
|
|
37
38
|
var radioGroup = require('@base-ui/react/radio-group');
|
|
38
39
|
var reactResizablePanels = require('react-resizable-panels');
|
|
39
|
-
var scrollArea = require('@base-ui/react/scroll-area');
|
|
40
40
|
var slider = require('@base-ui/react/slider');
|
|
41
41
|
var _switch = require('@base-ui/react/switch');
|
|
42
42
|
var tabs = require('@base-ui/react/tabs');
|
|
@@ -2337,10 +2337,10 @@ tailwindVariants.tv({
|
|
|
2337
2337
|
]
|
|
2338
2338
|
});
|
|
2339
2339
|
tailwindVariants.tv({
|
|
2340
|
-
base: ["fixed inset-0", "bg-black/80 flex items-center justify-center"
|
|
2340
|
+
base: ["zen-layer-modal fixed inset-0", "bg-black/80 flex items-center justify-center"]
|
|
2341
2341
|
});
|
|
2342
2342
|
tailwindVariants.tv({
|
|
2343
|
-
base: "relative
|
|
2343
|
+
base: "relative",
|
|
2344
2344
|
variants: {
|
|
2345
2345
|
position: {
|
|
2346
2346
|
center: "",
|
|
@@ -2490,7 +2490,7 @@ var alert = tailwindVariants.tv({
|
|
|
2490
2490
|
variant: {
|
|
2491
2491
|
default: "bg-surface-base text-foreground-primary",
|
|
2492
2492
|
danger: [
|
|
2493
|
-
"bg-surface-base text-status-error",
|
|
2493
|
+
"border-status-error bg-surface-base text-status-error",
|
|
2494
2494
|
"*:data-[slot=alert-description]:text-status-error/90"
|
|
2495
2495
|
]
|
|
2496
2496
|
}
|
|
@@ -3771,7 +3771,7 @@ function List({
|
|
|
3771
3771
|
};
|
|
3772
3772
|
const classes = cn(
|
|
3773
3773
|
"grid outline-none overflow-auto gap-1",
|
|
3774
|
-
isFullscreen && "block p-3 rounded-none fixed inset-0 overflow-auto
|
|
3774
|
+
isFullscreen && "zen-layer-floating block p-3 rounded-none fixed inset-0 overflow-auto bg-surface-base",
|
|
3775
3775
|
className
|
|
3776
3776
|
);
|
|
3777
3777
|
if (parent.kind === "select") {
|
|
@@ -4019,6 +4019,58 @@ var InputGroupTextarea = react.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
4019
4019
|
}
|
|
4020
4020
|
));
|
|
4021
4021
|
InputGroupTextarea.displayName = "InputGroupTextarea";
|
|
4022
|
+
var scrollbarClasses = [
|
|
4023
|
+
"flex touch-none select-none justify-center rounded bg-transparent",
|
|
4024
|
+
"opacity-0 transition-opacity duration-200 delay-300",
|
|
4025
|
+
"data-[hovering]:opacity-100 data-[hovering]:delay-0",
|
|
4026
|
+
"data-[scrolling]:opacity-100 data-[scrolling]:delay-0"
|
|
4027
|
+
];
|
|
4028
|
+
function ScrollArea({
|
|
4029
|
+
maxHeight,
|
|
4030
|
+
orientation = "vertical",
|
|
4031
|
+
className,
|
|
4032
|
+
style,
|
|
4033
|
+
children,
|
|
4034
|
+
...props
|
|
4035
|
+
}) {
|
|
4036
|
+
const showVertical = orientation !== "horizontal";
|
|
4037
|
+
const showHorizontal = orientation !== "vertical";
|
|
4038
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4039
|
+
scrollArea.ScrollArea.Root,
|
|
4040
|
+
{
|
|
4041
|
+
...props,
|
|
4042
|
+
className: cn("relative overflow-hidden", className),
|
|
4043
|
+
style,
|
|
4044
|
+
children: [
|
|
4045
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4046
|
+
scrollArea.ScrollArea.Viewport,
|
|
4047
|
+
{
|
|
4048
|
+
className: "size-full overscroll-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-focus-ring",
|
|
4049
|
+
style: { maxHeight },
|
|
4050
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Content, { children })
|
|
4051
|
+
}
|
|
4052
|
+
),
|
|
4053
|
+
showVertical && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4054
|
+
scrollArea.ScrollArea.Scrollbar,
|
|
4055
|
+
{
|
|
4056
|
+
orientation: "vertical",
|
|
4057
|
+
className: cn(scrollbarClasses, "w-1.5 mr-0.5"),
|
|
4058
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Thumb, { className: "w-full rounded bg-edge-strong" })
|
|
4059
|
+
}
|
|
4060
|
+
),
|
|
4061
|
+
showHorizontal && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4062
|
+
scrollArea.ScrollArea.Scrollbar,
|
|
4063
|
+
{
|
|
4064
|
+
orientation: "horizontal",
|
|
4065
|
+
className: cn(scrollbarClasses, "h-1.5 mb-0.5 flex-col"),
|
|
4066
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Thumb, { className: "h-full rounded bg-edge-strong" })
|
|
4067
|
+
}
|
|
4068
|
+
),
|
|
4069
|
+
orientation === "both" && /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Corner, {})
|
|
4070
|
+
]
|
|
4071
|
+
}
|
|
4072
|
+
);
|
|
4073
|
+
}
|
|
4022
4074
|
function getItemLabel(label) {
|
|
4023
4075
|
if (typeof label === "string" || typeof label === "number") {
|
|
4024
4076
|
return String(label);
|
|
@@ -4036,6 +4088,7 @@ function ComboBox({
|
|
|
4036
4088
|
label,
|
|
4037
4089
|
placeholder,
|
|
4038
4090
|
isDisabled,
|
|
4091
|
+
maxHeight,
|
|
4039
4092
|
onChange,
|
|
4040
4093
|
renderEmptyState,
|
|
4041
4094
|
listProps,
|
|
@@ -4072,16 +4125,25 @@ function ComboBox({
|
|
|
4072
4125
|
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Input, { placeholder, render: /* @__PURE__ */ jsxRuntime.jsx(InputGroupInput, {}) }),
|
|
4073
4126
|
/* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Trigger, { className: "flex size-6 shrink-0 items-center justify-center rounded text-foreground-muted hover:bg-interactive hover:text-foreground-primary", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { rotate: 90, "aria-hidden": "true", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.ChevronRight, {}) }) }) })
|
|
4074
4127
|
] }),
|
|
4075
|
-
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4128
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4129
|
+
combobox.Combobox.Positioner,
|
|
4130
|
+
{
|
|
4131
|
+
align: "start",
|
|
4132
|
+
sideOffset: 4,
|
|
4133
|
+
...popoverProps,
|
|
4134
|
+
className: cn("zen-layer-floating", popoverProps?.className),
|
|
4135
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(combobox.Combobox.Popup, { className: "zen-popover w-[var(--anchor-width)] max-w-[var(--available-width)] p-2 border border-edge rounded-md shadow-lg bg-surface-overlay outline-none", children: [
|
|
4136
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListPrimitiveProvider, { kind: "combobox", children: /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { maxHeight: maxHeight ?? "min(23rem, var(--available-height))", children: /* @__PURE__ */ jsxRuntime.jsx(List, { ...listProps, className: cn("overflow-visible", listProps?.className), children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Collection, { children: (value) => {
|
|
4137
|
+
const item = normalizedItems.find((option) => option.value === value);
|
|
4138
|
+
if (!item) {
|
|
4139
|
+
return null;
|
|
4140
|
+
}
|
|
4141
|
+
return item.element ?? /* @__PURE__ */ jsxRuntime.jsx(ListItem, { value: item.value, children: item.label }, item.value);
|
|
4142
|
+
} }) }) }) }),
|
|
4143
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Empty, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-16 items-center justify-center px-4 py-3 text-center", children: renderEmptyState ? renderEmptyState({}) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-foreground-muted", children: "No items found." }) }) })
|
|
4144
|
+
] })
|
|
4145
|
+
}
|
|
4146
|
+
) })
|
|
4085
4147
|
] })
|
|
4086
4148
|
}
|
|
4087
4149
|
);
|
|
@@ -4100,16 +4162,16 @@ function Modal({
|
|
|
4100
4162
|
...props
|
|
4101
4163
|
}) {
|
|
4102
4164
|
const { kind } = useOverlayTrigger();
|
|
4103
|
-
const popupClassName2 = cn("relative
|
|
4165
|
+
const popupClassName2 = cn("relative", placementClasses[placement], className);
|
|
4104
4166
|
if (kind === "alert-dialog") {
|
|
4105
4167
|
return /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialog.Portal, { ...props, children: [
|
|
4106
|
-
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Backdrop, { className: "zen-modal-overlay fixed inset-0 bg-black/80
|
|
4107
|
-
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Viewport, { className: "fixed inset-0 flex items-center justify-center
|
|
4168
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Backdrop, { className: "zen-modal-overlay zen-layer-backdrop fixed inset-0 bg-black/80" }),
|
|
4169
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Viewport, { className: "zen-layer-modal fixed inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Popup, { className: popupClassName2, style, children }) })
|
|
4108
4170
|
] });
|
|
4109
4171
|
}
|
|
4110
4172
|
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { ...props, children: [
|
|
4111
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay fixed inset-0 bg-black/80
|
|
4112
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "fixed inset-0 flex items-center justify-center
|
|
4173
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay zen-layer-backdrop fixed inset-0 bg-black/80" }),
|
|
4174
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "zen-layer-modal fixed inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Popup, { className: popupClassName2, style, children }) })
|
|
4113
4175
|
] });
|
|
4114
4176
|
}
|
|
4115
4177
|
Modal.zenOverlayType = "dialog";
|
|
@@ -4143,14 +4205,8 @@ function CommandInput({ className, ...props }) {
|
|
|
4143
4205
|
)
|
|
4144
4206
|
] });
|
|
4145
4207
|
}
|
|
4146
|
-
function CommandList({ className, ...props }) {
|
|
4147
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4148
|
-
cmdk.Command.List,
|
|
4149
|
-
{
|
|
4150
|
-
...props,
|
|
4151
|
-
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden p-2", className)
|
|
4152
|
-
}
|
|
4153
|
-
);
|
|
4208
|
+
function CommandList({ maxHeight = 300, className, ...props }) {
|
|
4209
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { maxHeight, children: /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.List, { ...props, className: cn("p-2", className) }) });
|
|
4154
4210
|
}
|
|
4155
4211
|
function CommandEmpty({ className, ...props }) {
|
|
4156
4212
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4820,12 +4876,12 @@ function Popover({
|
|
|
4820
4876
|
onOpenChange: _onOpenChange,
|
|
4821
4877
|
...props
|
|
4822
4878
|
}) {
|
|
4823
|
-
return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4879
|
+
return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { ...props, className: "zen-layer-floating", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4824
4880
|
popover.Popover.Popup,
|
|
4825
4881
|
{
|
|
4826
4882
|
className: cn(
|
|
4827
4883
|
"zen-popover outline-none",
|
|
4828
|
-
isFullscreen && "zen-popover-fullscreen block border-0 rounded-none fixed inset-0 overflow-auto
|
|
4884
|
+
isFullscreen && "zen-popover-fullscreen block border-0 rounded-none fixed inset-0 overflow-auto bg-surface-base",
|
|
4829
4885
|
className
|
|
4830
4886
|
),
|
|
4831
4887
|
children
|
|
@@ -5000,23 +5056,32 @@ function Tooltip({
|
|
|
5000
5056
|
showArrow,
|
|
5001
5057
|
...props
|
|
5002
5058
|
}) {
|
|
5003
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tooltip$1.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5059
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tooltip$1.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5060
|
+
tooltip$1.Tooltip.Positioner,
|
|
5061
|
+
{
|
|
5062
|
+
...props,
|
|
5063
|
+
className: "zen-layer-floating",
|
|
5064
|
+
side: placement ?? side,
|
|
5065
|
+
sideOffset,
|
|
5066
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip$1.Tooltip.Popup, { className: cn("zen-popover group", tooltip(), className), children: [
|
|
5067
|
+
showArrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5068
|
+
tooltip$1.Tooltip.Arrow,
|
|
5069
|
+
{
|
|
5070
|
+
style: ({ side: side2 }) => ({
|
|
5071
|
+
width: 12,
|
|
5072
|
+
height: 6,
|
|
5073
|
+
...side2 === "top" && { bottom: -6, transform: "rotate(180deg)" },
|
|
5074
|
+
...side2 === "bottom" && { top: -6 },
|
|
5075
|
+
...side2 === "left" && { right: -9, transform: "rotate(90deg)" },
|
|
5076
|
+
...side2 === "right" && { left: -9, transform: "rotate(-90deg)" }
|
|
5077
|
+
}),
|
|
5078
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 12 6", className: "block w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 6 6 0l6 6Z", className: "fill-surface-inverted" }) })
|
|
5079
|
+
}
|
|
5080
|
+
),
|
|
5081
|
+
children
|
|
5082
|
+
] })
|
|
5083
|
+
}
|
|
5084
|
+
) });
|
|
5020
5085
|
}
|
|
5021
5086
|
function TooltipBubble({
|
|
5022
5087
|
children,
|
|
@@ -5042,7 +5107,7 @@ function FloatingTooltip({ className, style, children, ...props }) {
|
|
|
5042
5107
|
{
|
|
5043
5108
|
...props,
|
|
5044
5109
|
className: cn(
|
|
5045
|
-
"fixed pointer-events-none
|
|
5110
|
+
"zen-layer-floating fixed pointer-events-none -translate-x-1/2 -translate-y-[calc(100%+10px)]",
|
|
5046
5111
|
className
|
|
5047
5112
|
),
|
|
5048
5113
|
style: { ...style, left: position.x, top: position.y },
|
|
@@ -5319,7 +5384,7 @@ function HoverTrigger({
|
|
|
5319
5384
|
render: /* @__PURE__ */ jsxRuntime.jsx("span", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: triggerElement })
|
|
5320
5385
|
}
|
|
5321
5386
|
),
|
|
5322
|
-
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Popup, { className: "zen-popover outline-none", children: /* @__PURE__ */ jsxRuntime.jsx("div", { onMouseEnter: handleMenuEnter, onMouseLeave: handleMenuLeave, children: /* @__PURE__ */ jsxRuntime.jsx(OverlayContentProvider, { close: _close, kind: "popover", children: popupElement }) }) }) }) })
|
|
5387
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { className: "zen-layer-floating", children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Popup, { className: "zen-popover outline-none", children: /* @__PURE__ */ jsxRuntime.jsx("div", { onMouseEnter: handleMenuEnter, onMouseLeave: handleMenuLeave, children: /* @__PURE__ */ jsxRuntime.jsx(OverlayContentProvider, { close: _close, kind: "popover", children: popupElement }) }) }) }) })
|
|
5323
5388
|
] });
|
|
5324
5389
|
}
|
|
5325
5390
|
var breakpoints = {
|
|
@@ -5551,7 +5616,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5551
5616
|
Column,
|
|
5552
5617
|
{
|
|
5553
5618
|
gap: "2",
|
|
5554
|
-
className: cn("fixed
|
|
5619
|
+
className: cn("zen-layer-toast fixed", positionClasses[position]),
|
|
5555
5620
|
onMouseEnter: () => setHovered(true),
|
|
5556
5621
|
onMouseLeave: () => setHovered(false),
|
|
5557
5622
|
children: transitions((style, item) => {
|
|
@@ -5716,10 +5781,17 @@ function Menu({
|
|
|
5716
5781
|
);
|
|
5717
5782
|
const popupContent = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { selected, select }, children });
|
|
5718
5783
|
if (primitiveKind === "context-menu") {
|
|
5719
|
-
return /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Popup, { ...props, className: cn("zen-popover", popupClassName2), children: popupContent }) }) });
|
|
5784
|
+
return /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Positioner, { className: "zen-layer-floating", children: /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Popup, { ...props, className: cn("zen-popover", popupClassName2), children: popupContent }) }) });
|
|
5720
5785
|
}
|
|
5721
5786
|
if (primitiveKind === "menu") {
|
|
5722
|
-
return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5787
|
+
return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5788
|
+
menu.Menu.Positioner,
|
|
5789
|
+
{
|
|
5790
|
+
...inMenubar ? { align: "start", sideOffset: 8 } : {},
|
|
5791
|
+
className: "zen-layer-floating",
|
|
5792
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Popup, { ...props, className: cn("zen-popover", popupClassName2), children: popupContent })
|
|
5793
|
+
}
|
|
5794
|
+
) });
|
|
5723
5795
|
}
|
|
5724
5796
|
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { selected, select }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, role: "menu", className: popupClassName2, children }) });
|
|
5725
5797
|
}
|
|
@@ -5837,10 +5909,11 @@ function MenuSection({
|
|
|
5837
5909
|
}) {
|
|
5838
5910
|
const primitiveKind = react.useContext(MenuPrimitiveContext);
|
|
5839
5911
|
const groupClassName = cn("[&:not(:last-child)]:mb-4", className);
|
|
5840
|
-
const groupStyle =
|
|
5912
|
+
const groupStyle = style;
|
|
5913
|
+
const body = maxHeight ? /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { maxHeight, children }) : children;
|
|
5841
5914
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5842
5915
|
title && (primitiveKind === "context-menu" ? /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.GroupLabel, { className: "text-base font-bold px-2 py-1.5", children: title }) : primitiveKind === "menu" ? /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.GroupLabel, { className: "text-base font-bold px-2 py-1.5", children: title }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base font-bold px-2 py-1.5", children: title })),
|
|
5843
|
-
|
|
5916
|
+
body
|
|
5844
5917
|
] });
|
|
5845
5918
|
if (primitiveKind === "context-menu") {
|
|
5846
5919
|
return /* @__PURE__ */ jsxRuntime.jsx(contextMenu.ContextMenu.Group, { ...props, className: groupClassName, style: groupStyle, children: content });
|
|
@@ -5980,7 +6053,7 @@ function Navbar({
|
|
|
5980
6053
|
/* @__PURE__ */ jsxRuntime.jsx(navigationMenu.NavigationMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5981
6054
|
navigationMenu.NavigationMenu.Positioner,
|
|
5982
6055
|
{
|
|
5983
|
-
className: positionerClassName,
|
|
6056
|
+
className: cn("zen-layer-floating", positionerClassName),
|
|
5984
6057
|
sideOffset: 10,
|
|
5985
6058
|
collisionPadding: 16,
|
|
5986
6059
|
style: {
|
|
@@ -6479,58 +6552,6 @@ function ResizableHandle({ withHandle, className, ...props }) {
|
|
|
6479
6552
|
}
|
|
6480
6553
|
);
|
|
6481
6554
|
}
|
|
6482
|
-
var scrollbarClasses = [
|
|
6483
|
-
"flex touch-none select-none justify-center rounded bg-transparent",
|
|
6484
|
-
"opacity-0 transition-opacity duration-200 delay-300",
|
|
6485
|
-
"data-[hovering]:opacity-100 data-[hovering]:delay-0",
|
|
6486
|
-
"data-[scrolling]:opacity-100 data-[scrolling]:delay-0"
|
|
6487
|
-
];
|
|
6488
|
-
function ScrollArea({
|
|
6489
|
-
maxHeight,
|
|
6490
|
-
orientation = "vertical",
|
|
6491
|
-
className,
|
|
6492
|
-
style,
|
|
6493
|
-
children,
|
|
6494
|
-
...props
|
|
6495
|
-
}) {
|
|
6496
|
-
const showVertical = orientation !== "horizontal";
|
|
6497
|
-
const showHorizontal = orientation !== "vertical";
|
|
6498
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6499
|
-
scrollArea.ScrollArea.Root,
|
|
6500
|
-
{
|
|
6501
|
-
...props,
|
|
6502
|
-
className: cn("relative overflow-hidden", className),
|
|
6503
|
-
style,
|
|
6504
|
-
children: [
|
|
6505
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6506
|
-
scrollArea.ScrollArea.Viewport,
|
|
6507
|
-
{
|
|
6508
|
-
className: "size-full overscroll-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-focus-ring",
|
|
6509
|
-
style: { maxHeight },
|
|
6510
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Content, { children })
|
|
6511
|
-
}
|
|
6512
|
-
),
|
|
6513
|
-
showVertical && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6514
|
-
scrollArea.ScrollArea.Scrollbar,
|
|
6515
|
-
{
|
|
6516
|
-
orientation: "vertical",
|
|
6517
|
-
className: cn(scrollbarClasses, "w-1.5 mr-0.5"),
|
|
6518
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Thumb, { className: "w-full rounded bg-edge-strong" })
|
|
6519
|
-
}
|
|
6520
|
-
),
|
|
6521
|
-
showHorizontal && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6522
|
-
scrollArea.ScrollArea.Scrollbar,
|
|
6523
|
-
{
|
|
6524
|
-
orientation: "horizontal",
|
|
6525
|
-
className: cn(scrollbarClasses, "h-1.5 mb-0.5 flex-col"),
|
|
6526
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Thumb, { className: "h-full rounded bg-edge-strong" })
|
|
6527
|
-
}
|
|
6528
|
-
),
|
|
6529
|
-
orientation === "both" && /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Corner, {})
|
|
6530
|
-
]
|
|
6531
|
-
}
|
|
6532
|
-
);
|
|
6533
|
-
}
|
|
6534
6555
|
function SearchField({
|
|
6535
6556
|
label,
|
|
6536
6557
|
placeholder,
|
|
@@ -6597,6 +6618,24 @@ function SearchField({
|
|
|
6597
6618
|
] })
|
|
6598
6619
|
] });
|
|
6599
6620
|
}
|
|
6621
|
+
function getSelectItemLabel(children, selectedValue) {
|
|
6622
|
+
let label;
|
|
6623
|
+
react.Children.forEach(children, (child) => {
|
|
6624
|
+
if (label !== void 0 || !react.isValidElement(child)) {
|
|
6625
|
+
return;
|
|
6626
|
+
}
|
|
6627
|
+
if (child.type === ListItem) {
|
|
6628
|
+
const props = child.props;
|
|
6629
|
+
const itemValue = props.value ?? props.id ?? (typeof props.children === "string" ? props.children : "");
|
|
6630
|
+
if (itemValue === selectedValue) {
|
|
6631
|
+
label = props.children;
|
|
6632
|
+
}
|
|
6633
|
+
return;
|
|
6634
|
+
}
|
|
6635
|
+
label = getSelectItemLabel(child.props.children, selectedValue);
|
|
6636
|
+
});
|
|
6637
|
+
return label;
|
|
6638
|
+
}
|
|
6600
6639
|
function Select({
|
|
6601
6640
|
value,
|
|
6602
6641
|
defaultValue,
|
|
@@ -6630,6 +6669,7 @@ function Select({
|
|
|
6630
6669
|
(item) => typeof item === "object" ? item : { label: String(item), value: item }
|
|
6631
6670
|
);
|
|
6632
6671
|
const collection = children || normalizedItems?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(ListItem, { value: item.value, children: item.label }, item.value));
|
|
6672
|
+
const isEmpty = !collection || Array.isArray(collection) && collection.length === 0;
|
|
6633
6673
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-1", className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6634
6674
|
select.Select.Root,
|
|
6635
6675
|
{
|
|
@@ -6662,7 +6702,7 @@ function Select({
|
|
|
6662
6702
|
),
|
|
6663
6703
|
children: [
|
|
6664
6704
|
/* @__PURE__ */ jsxRuntime.jsx(select.Select.Value, { placeholder, children: (selected) => {
|
|
6665
|
-
const defaultChildren = selected ??
|
|
6705
|
+
const defaultChildren = selected == null ? placeholder : getSelectItemLabel(collection, selected) ?? selected;
|
|
6666
6706
|
return typeof renderValue === "function" ? renderValue({
|
|
6667
6707
|
defaultChildren,
|
|
6668
6708
|
isPlaceholder: selected == null
|
|
@@ -6679,18 +6719,19 @@ function Select({
|
|
|
6679
6719
|
sideOffset: 4,
|
|
6680
6720
|
alignItemWithTrigger,
|
|
6681
6721
|
...popoverProps,
|
|
6722
|
+
className: cn("zen-layer-floating", popoverProps?.className),
|
|
6682
6723
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6683
6724
|
select.Select.Popup,
|
|
6684
6725
|
{
|
|
6685
6726
|
className: cn(
|
|
6686
6727
|
"zen-popover bg-surface-overlay border border-edge rounded-md shadow-lg outline-none",
|
|
6687
|
-
isFullscreen && "zen-popover-fullscreen fixed inset-0 rounded-none
|
|
6728
|
+
isFullscreen && "zen-popover-fullscreen fixed inset-0 rounded-none"
|
|
6688
6729
|
),
|
|
6689
6730
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "2", padding: "2", children: [
|
|
6690
6731
|
allowSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6691
6732
|
SearchField,
|
|
6692
6733
|
{
|
|
6693
|
-
className: "
|
|
6734
|
+
className: "-mx-2 -mt-2 w-auto rounded-t-md rounded-b-none border-0 border-b border-edge shadow-none focus-within:border-edge",
|
|
6694
6735
|
value: search,
|
|
6695
6736
|
onChange: setSearch,
|
|
6696
6737
|
onSearch: (value2) => {
|
|
@@ -6708,18 +6749,22 @@ function Select({
|
|
|
6708
6749
|
}
|
|
6709
6750
|
),
|
|
6710
6751
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx(Loading, { className: "py-8", icon: "dots", placement: "center", size: "sm" }),
|
|
6752
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-8 text-center text-base text-foreground-muted", children: "No results found" }),
|
|
6711
6753
|
/* @__PURE__ */ jsxRuntime.jsx(ListPrimitiveProvider, { kind: "select", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6712
|
-
|
|
6754
|
+
ScrollArea,
|
|
6713
6755
|
{
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6756
|
+
maxHeight,
|
|
6757
|
+
style: { display: isLoading || isEmpty ? "none" : void 0 },
|
|
6758
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6759
|
+
List,
|
|
6760
|
+
{
|
|
6761
|
+
...listProps,
|
|
6762
|
+
isFullscreen,
|
|
6763
|
+
className: cn("overflow-visible", listProps?.className),
|
|
6764
|
+
style: listProps?.style,
|
|
6765
|
+
children: collection
|
|
6766
|
+
}
|
|
6767
|
+
)
|
|
6723
6768
|
}
|
|
6724
6769
|
) })
|
|
6725
6770
|
] })
|
|
@@ -6753,12 +6798,12 @@ function Sheet({
|
|
|
6753
6798
|
...style
|
|
6754
6799
|
};
|
|
6755
6800
|
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { ...props, children: [
|
|
6756
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay fixed inset-0 bg-black/80
|
|
6757
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "fixed inset-0
|
|
6801
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay zen-layer-backdrop fixed inset-0 bg-black/80" }),
|
|
6802
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "zen-layer-modal fixed inset-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6758
6803
|
dialog.Dialog.Popup,
|
|
6759
6804
|
{
|
|
6760
6805
|
className: cn(
|
|
6761
|
-
"relative
|
|
6806
|
+
"relative p-6 overflow-auto outline-none",
|
|
6762
6807
|
"bg-surface-base border-edge shadow-xl",
|
|
6763
6808
|
sideClasses[side],
|
|
6764
6809
|
className
|