@umami/react-zen 0.247.0 → 0.249.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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +108 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
- package/styles.css +30 -5
- package/styles.full.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -666,7 +666,7 @@ interface ButtonRenderProps {
|
|
|
666
666
|
children: ReactNode;
|
|
667
667
|
[key: string]: unknown;
|
|
668
668
|
}
|
|
669
|
-
declare function Button({ variant, size, render, preventFocusOnPress: _preventFocusOnPress, isDisabled, disabled, onPress, onClick, className, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
669
|
+
declare function Button({ variant, size, render, preventFocusOnPress: _preventFocusOnPress, nativeButton, isDisabled, disabled, onPress, onClick, className, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
670
670
|
|
|
671
671
|
interface SeparatorProps extends Separator$1.Props {
|
|
672
672
|
orientation?: 'horizontal' | 'vertical';
|
package/dist/index.d.ts
CHANGED
|
@@ -666,7 +666,7 @@ interface ButtonRenderProps {
|
|
|
666
666
|
children: ReactNode;
|
|
667
667
|
[key: string]: unknown;
|
|
668
668
|
}
|
|
669
|
-
declare function Button({ variant, size, render, preventFocusOnPress: _preventFocusOnPress, isDisabled, disabled, onPress, onClick, className, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
669
|
+
declare function Button({ variant, size, render, preventFocusOnPress: _preventFocusOnPress, nativeButton, isDisabled, disabled, onPress, onClick, className, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
670
670
|
|
|
671
671
|
interface SeparatorProps extends Separator$1.Props {
|
|
672
672
|
orientation?: 'horizontal' | 'vertical';
|
package/dist/index.js
CHANGED
|
@@ -2268,7 +2268,8 @@ var button = tailwindVariants.tv({
|
|
|
2268
2268
|
default: [
|
|
2269
2269
|
"bg-interactive text-foreground-primary",
|
|
2270
2270
|
"hover:bg-interactive-hover",
|
|
2271
|
-
"pressed:bg-interactive-pressed"
|
|
2271
|
+
"pressed:bg-interactive-pressed",
|
|
2272
|
+
"disabled:text-foreground-disabled"
|
|
2272
2273
|
],
|
|
2273
2274
|
primary: [
|
|
2274
2275
|
"bg-primary text-primary-foreground",
|
|
@@ -2280,16 +2281,26 @@ var button = tailwindVariants.tv({
|
|
|
2280
2281
|
"bg-surface-base border-edge shadow-sm text-foreground-primary",
|
|
2281
2282
|
"hover:border-edge-strong",
|
|
2282
2283
|
"pressed:bg-surface-raised",
|
|
2283
|
-
"disabled:bg-surface-disabled"
|
|
2284
|
+
"disabled:bg-surface-disabled disabled:text-foreground-disabled"
|
|
2285
|
+
],
|
|
2286
|
+
quiet: [
|
|
2287
|
+
"bg-transparent",
|
|
2288
|
+
"hover:bg-interactive",
|
|
2289
|
+
"pressed:bg-interactive-hover",
|
|
2290
|
+
"disabled:text-foreground-disabled"
|
|
2284
2291
|
],
|
|
2285
|
-
quiet: ["bg-transparent", "hover:bg-interactive", "pressed:bg-interactive-hover"],
|
|
2286
2292
|
danger: [
|
|
2287
2293
|
"bg-status-error text-white",
|
|
2288
2294
|
"hover:opacity-90",
|
|
2289
2295
|
"pressed:opacity-80",
|
|
2290
2296
|
"disabled:opacity-50"
|
|
2291
2297
|
],
|
|
2292
|
-
zero: [
|
|
2298
|
+
zero: [
|
|
2299
|
+
"bg-transparent border-0",
|
|
2300
|
+
"hover:bg-transparent",
|
|
2301
|
+
"pressed:bg-transparent",
|
|
2302
|
+
"disabled:text-foreground-disabled"
|
|
2303
|
+
]
|
|
2293
2304
|
},
|
|
2294
2305
|
size: {
|
|
2295
2306
|
xs: "text-sm py-1 px-2",
|
|
@@ -2337,10 +2348,10 @@ tailwindVariants.tv({
|
|
|
2337
2348
|
]
|
|
2338
2349
|
});
|
|
2339
2350
|
tailwindVariants.tv({
|
|
2340
|
-
base: ["fixed inset-0", "bg-black/80 flex items-center justify-center"
|
|
2351
|
+
base: ["zen-layer-modal fixed inset-0", "bg-black/80 flex items-center justify-center"]
|
|
2341
2352
|
});
|
|
2342
2353
|
tailwindVariants.tv({
|
|
2343
|
-
base: "relative
|
|
2354
|
+
base: "relative",
|
|
2344
2355
|
variants: {
|
|
2345
2356
|
position: {
|
|
2346
2357
|
center: "",
|
|
@@ -2694,6 +2705,7 @@ function Button({
|
|
|
2694
2705
|
size = "md",
|
|
2695
2706
|
render,
|
|
2696
2707
|
preventFocusOnPress: _preventFocusOnPress = true,
|
|
2708
|
+
nativeButton,
|
|
2697
2709
|
isDisabled,
|
|
2698
2710
|
disabled,
|
|
2699
2711
|
onPress,
|
|
@@ -2703,6 +2715,7 @@ function Button({
|
|
|
2703
2715
|
...props
|
|
2704
2716
|
}) {
|
|
2705
2717
|
const buttonClassName = button({ variant, size, className });
|
|
2718
|
+
const isNativeButton = nativeButton ?? (render === void 0 || react.isValidElement(render) && render.type === "button");
|
|
2706
2719
|
const handleClick = (event) => {
|
|
2707
2720
|
onClick?.(event);
|
|
2708
2721
|
if (!event.defaultPrevented) {
|
|
@@ -2715,6 +2728,7 @@ function Button({
|
|
|
2715
2728
|
...props,
|
|
2716
2729
|
"data-slot": "button",
|
|
2717
2730
|
render,
|
|
2731
|
+
nativeButton: isNativeButton,
|
|
2718
2732
|
disabled: isDisabled ?? disabled,
|
|
2719
2733
|
className: buttonClassName,
|
|
2720
2734
|
onClick: handleClick,
|
|
@@ -3226,7 +3240,7 @@ function Breadcrumb({ children, className, isDisabled, ...props }) {
|
|
|
3226
3240
|
"aria-disabled": isDisabled || void 0,
|
|
3227
3241
|
className: cn(
|
|
3228
3242
|
"flex items-center text-base gap-3 list-none",
|
|
3229
|
-
"[&_a]:text-foreground-muted [&_a]:no-underline [&_a]:font-normal
|
|
3243
|
+
"[&_a]:text-foreground-muted [&_a]:no-underline [&_a]:font-normal",
|
|
3230
3244
|
"[&_a:hover]:text-foreground-primary",
|
|
3231
3245
|
"last:[&>span]:hidden",
|
|
3232
3246
|
className
|
|
@@ -3771,7 +3785,7 @@ function List({
|
|
|
3771
3785
|
};
|
|
3772
3786
|
const classes = cn(
|
|
3773
3787
|
"grid outline-none overflow-auto gap-1",
|
|
3774
|
-
isFullscreen && "block p-3 rounded-none fixed inset-0 overflow-auto
|
|
3788
|
+
isFullscreen && "zen-layer-floating block p-3 rounded-none fixed inset-0 overflow-auto bg-surface-base",
|
|
3775
3789
|
className
|
|
3776
3790
|
);
|
|
3777
3791
|
if (parent.kind === "select") {
|
|
@@ -4125,23 +4139,25 @@ function ComboBox({
|
|
|
4125
4139
|
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Input, { placeholder, render: /* @__PURE__ */ jsxRuntime.jsx(InputGroupInput, {}) }),
|
|
4126
4140
|
/* @__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, {}) }) }) })
|
|
4127
4141
|
] }),
|
|
4128
|
-
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4142
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4143
|
+
combobox.Combobox.Positioner,
|
|
4144
|
+
{
|
|
4145
|
+
align: "start",
|
|
4146
|
+
sideOffset: 4,
|
|
4147
|
+
...popoverProps,
|
|
4148
|
+
className: cn("zen-layer-floating", popoverProps?.className),
|
|
4149
|
+
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: [
|
|
4150
|
+
/* @__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) => {
|
|
4135
4151
|
const item = normalizedItems.find((option) => option.value === value);
|
|
4136
4152
|
if (!item) {
|
|
4137
4153
|
return null;
|
|
4138
4154
|
}
|
|
4139
4155
|
return item.element ?? /* @__PURE__ */ jsxRuntime.jsx(ListItem, { value: item.value, children: item.label }, item.value);
|
|
4140
|
-
} })
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4156
|
+
} }) }) }) }),
|
|
4157
|
+
/* @__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." }) }) })
|
|
4158
|
+
] })
|
|
4159
|
+
}
|
|
4160
|
+
) })
|
|
4145
4161
|
] })
|
|
4146
4162
|
}
|
|
4147
4163
|
);
|
|
@@ -4160,16 +4176,16 @@ function Modal({
|
|
|
4160
4176
|
...props
|
|
4161
4177
|
}) {
|
|
4162
4178
|
const { kind } = useOverlayTrigger();
|
|
4163
|
-
const popupClassName2 = cn("relative
|
|
4179
|
+
const popupClassName2 = cn("relative", placementClasses[placement], className);
|
|
4164
4180
|
if (kind === "alert-dialog") {
|
|
4165
4181
|
return /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialog.Portal, { ...props, children: [
|
|
4166
|
-
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Backdrop, { className: "zen-modal-overlay fixed inset-0 bg-black/80
|
|
4167
|
-
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Viewport, { className: "fixed inset-0 flex items-center justify-center
|
|
4182
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Backdrop, { className: "zen-modal-overlay zen-layer-backdrop fixed inset-0 bg-black/80" }),
|
|
4183
|
+
/* @__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 }) })
|
|
4168
4184
|
] });
|
|
4169
4185
|
}
|
|
4170
4186
|
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { ...props, children: [
|
|
4171
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay fixed inset-0 bg-black/80
|
|
4172
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "fixed inset-0 flex items-center justify-center
|
|
4187
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay zen-layer-backdrop fixed inset-0 bg-black/80" }),
|
|
4188
|
+
/* @__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 }) })
|
|
4173
4189
|
] });
|
|
4174
4190
|
}
|
|
4175
4191
|
Modal.zenOverlayType = "dialog";
|
|
@@ -4874,12 +4890,12 @@ function Popover({
|
|
|
4874
4890
|
onOpenChange: _onOpenChange,
|
|
4875
4891
|
...props
|
|
4876
4892
|
}) {
|
|
4877
|
-
return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4893
|
+
return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { ...props, className: "zen-layer-floating", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4878
4894
|
popover.Popover.Popup,
|
|
4879
4895
|
{
|
|
4880
4896
|
className: cn(
|
|
4881
4897
|
"zen-popover outline-none",
|
|
4882
|
-
isFullscreen && "zen-popover-fullscreen block border-0 rounded-none fixed inset-0 overflow-auto
|
|
4898
|
+
isFullscreen && "zen-popover-fullscreen block border-0 rounded-none fixed inset-0 overflow-auto bg-surface-base",
|
|
4883
4899
|
className
|
|
4884
4900
|
),
|
|
4885
4901
|
children
|
|
@@ -5054,23 +5070,32 @@ function Tooltip({
|
|
|
5054
5070
|
showArrow,
|
|
5055
5071
|
...props
|
|
5056
5072
|
}) {
|
|
5057
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tooltip$1.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5073
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tooltip$1.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5074
|
+
tooltip$1.Tooltip.Positioner,
|
|
5075
|
+
{
|
|
5076
|
+
...props,
|
|
5077
|
+
className: "zen-layer-floating",
|
|
5078
|
+
side: placement ?? side,
|
|
5079
|
+
sideOffset,
|
|
5080
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip$1.Tooltip.Popup, { className: cn("zen-popover group", tooltip(), className), children: [
|
|
5081
|
+
showArrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5082
|
+
tooltip$1.Tooltip.Arrow,
|
|
5083
|
+
{
|
|
5084
|
+
style: ({ side: side2 }) => ({
|
|
5085
|
+
width: 12,
|
|
5086
|
+
height: 6,
|
|
5087
|
+
...side2 === "top" && { bottom: -6, transform: "rotate(180deg)" },
|
|
5088
|
+
...side2 === "bottom" && { top: -6 },
|
|
5089
|
+
...side2 === "left" && { right: -9, transform: "rotate(90deg)" },
|
|
5090
|
+
...side2 === "right" && { left: -9, transform: "rotate(-90deg)" }
|
|
5091
|
+
}),
|
|
5092
|
+
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" }) })
|
|
5093
|
+
}
|
|
5094
|
+
),
|
|
5095
|
+
children
|
|
5096
|
+
] })
|
|
5097
|
+
}
|
|
5098
|
+
) });
|
|
5074
5099
|
}
|
|
5075
5100
|
function TooltipBubble({
|
|
5076
5101
|
children,
|
|
@@ -5096,7 +5121,7 @@ function FloatingTooltip({ className, style, children, ...props }) {
|
|
|
5096
5121
|
{
|
|
5097
5122
|
...props,
|
|
5098
5123
|
className: cn(
|
|
5099
|
-
"fixed pointer-events-none
|
|
5124
|
+
"zen-layer-floating fixed pointer-events-none -translate-x-1/2 -translate-y-[calc(100%+10px)]",
|
|
5100
5125
|
className
|
|
5101
5126
|
),
|
|
5102
5127
|
style: { ...style, left: position.x, top: position.y },
|
|
@@ -5373,7 +5398,7 @@ function HoverTrigger({
|
|
|
5373
5398
|
render: /* @__PURE__ */ jsxRuntime.jsx("span", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: triggerElement })
|
|
5374
5399
|
}
|
|
5375
5400
|
),
|
|
5376
|
-
/* @__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 }) }) }) }) })
|
|
5401
|
+
/* @__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 }) }) }) }) })
|
|
5377
5402
|
] });
|
|
5378
5403
|
}
|
|
5379
5404
|
var breakpoints = {
|
|
@@ -5605,7 +5630,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5605
5630
|
Column,
|
|
5606
5631
|
{
|
|
5607
5632
|
gap: "2",
|
|
5608
|
-
className: cn("fixed
|
|
5633
|
+
className: cn("zen-layer-toast fixed", positionClasses[position]),
|
|
5609
5634
|
onMouseEnter: () => setHovered(true),
|
|
5610
5635
|
onMouseLeave: () => setHovered(false),
|
|
5611
5636
|
children: transitions((style, item) => {
|
|
@@ -5770,10 +5795,18 @@ function Menu({
|
|
|
5770
5795
|
);
|
|
5771
5796
|
const popupContent = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { selected, select }, children });
|
|
5772
5797
|
if (primitiveKind === "context-menu") {
|
|
5773
|
-
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 }) }) });
|
|
5798
|
+
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 }) }) });
|
|
5774
5799
|
}
|
|
5775
5800
|
if (primitiveKind === "menu") {
|
|
5776
|
-
return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5801
|
+
return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5802
|
+
menu.Menu.Positioner,
|
|
5803
|
+
{
|
|
5804
|
+
sideOffset: 4,
|
|
5805
|
+
...inMenubar ? { align: "start" } : {},
|
|
5806
|
+
className: "zen-layer-floating",
|
|
5807
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Popup, { ...props, className: cn("zen-popover", popupClassName2), children: popupContent })
|
|
5808
|
+
}
|
|
5809
|
+
) });
|
|
5777
5810
|
}
|
|
5778
5811
|
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { selected, select }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, role: "menu", className: popupClassName2, children }) });
|
|
5779
5812
|
}
|
|
@@ -5933,10 +5966,7 @@ function Menubar({ isDisabled, className, children, ...props }) {
|
|
|
5933
5966
|
{
|
|
5934
5967
|
...props,
|
|
5935
5968
|
disabled: isDisabled,
|
|
5936
|
-
className: cn(
|
|
5937
|
-
"flex items-center gap-1 p-1 rounded-md border border-edge bg-surface-base shadow-sm w-fit",
|
|
5938
|
-
className
|
|
5939
|
-
),
|
|
5969
|
+
className: cn("flex items-center gap-1 w-fit", className),
|
|
5940
5970
|
children
|
|
5941
5971
|
}
|
|
5942
5972
|
);
|
|
@@ -6035,7 +6065,7 @@ function Navbar({
|
|
|
6035
6065
|
/* @__PURE__ */ jsxRuntime.jsx(navigationMenu.NavigationMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6036
6066
|
navigationMenu.NavigationMenu.Positioner,
|
|
6037
6067
|
{
|
|
6038
|
-
className: positionerClassName,
|
|
6068
|
+
className: cn("zen-layer-floating", positionerClassName),
|
|
6039
6069
|
sideOffset: 10,
|
|
6040
6070
|
collisionPadding: 16,
|
|
6041
6071
|
style: {
|
|
@@ -6600,6 +6630,24 @@ function SearchField({
|
|
|
6600
6630
|
] })
|
|
6601
6631
|
] });
|
|
6602
6632
|
}
|
|
6633
|
+
function getSelectItemLabel(children, selectedValue) {
|
|
6634
|
+
let label;
|
|
6635
|
+
react.Children.forEach(children, (child) => {
|
|
6636
|
+
if (label !== void 0 || !react.isValidElement(child)) {
|
|
6637
|
+
return;
|
|
6638
|
+
}
|
|
6639
|
+
if (child.type === ListItem) {
|
|
6640
|
+
const props = child.props;
|
|
6641
|
+
const itemValue = props.value ?? props.id ?? (typeof props.children === "string" ? props.children : "");
|
|
6642
|
+
if (itemValue === selectedValue) {
|
|
6643
|
+
label = props.children;
|
|
6644
|
+
}
|
|
6645
|
+
return;
|
|
6646
|
+
}
|
|
6647
|
+
label = getSelectItemLabel(child.props.children, selectedValue);
|
|
6648
|
+
});
|
|
6649
|
+
return label;
|
|
6650
|
+
}
|
|
6603
6651
|
function Select({
|
|
6604
6652
|
value,
|
|
6605
6653
|
defaultValue,
|
|
@@ -6666,7 +6714,7 @@ function Select({
|
|
|
6666
6714
|
),
|
|
6667
6715
|
children: [
|
|
6668
6716
|
/* @__PURE__ */ jsxRuntime.jsx(select.Select.Value, { placeholder, children: (selected) => {
|
|
6669
|
-
const defaultChildren = selected ??
|
|
6717
|
+
const defaultChildren = selected == null ? placeholder : getSelectItemLabel(collection, selected) ?? selected;
|
|
6670
6718
|
return typeof renderValue === "function" ? renderValue({
|
|
6671
6719
|
defaultChildren,
|
|
6672
6720
|
isPlaceholder: selected == null
|
|
@@ -6683,12 +6731,13 @@ function Select({
|
|
|
6683
6731
|
sideOffset: 4,
|
|
6684
6732
|
alignItemWithTrigger,
|
|
6685
6733
|
...popoverProps,
|
|
6734
|
+
className: cn("zen-layer-floating", popoverProps?.className),
|
|
6686
6735
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6687
6736
|
select.Select.Popup,
|
|
6688
6737
|
{
|
|
6689
6738
|
className: cn(
|
|
6690
6739
|
"zen-popover bg-surface-overlay border border-edge rounded-md shadow-lg outline-none",
|
|
6691
|
-
isFullscreen && "zen-popover-fullscreen fixed inset-0 rounded-none
|
|
6740
|
+
isFullscreen && "zen-popover-fullscreen fixed inset-0 rounded-none"
|
|
6692
6741
|
),
|
|
6693
6742
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "2", padding: "2", children: [
|
|
6694
6743
|
allowSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6761,12 +6810,12 @@ function Sheet({
|
|
|
6761
6810
|
...style
|
|
6762
6811
|
};
|
|
6763
6812
|
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { ...props, children: [
|
|
6764
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay fixed inset-0 bg-black/80
|
|
6765
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "fixed inset-0
|
|
6813
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "zen-modal-overlay zen-layer-backdrop fixed inset-0 bg-black/80" }),
|
|
6814
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "zen-layer-modal fixed inset-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6766
6815
|
dialog.Dialog.Popup,
|
|
6767
6816
|
{
|
|
6768
6817
|
className: cn(
|
|
6769
|
-
"relative
|
|
6818
|
+
"relative p-6 overflow-auto outline-none",
|
|
6770
6819
|
"bg-surface-base border-edge shadow-xl",
|
|
6771
6820
|
sideClasses[side],
|
|
6772
6821
|
className
|