@umami/react-zen 0.247.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.js +87 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -50
- 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.js
CHANGED
|
@@ -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: "",
|
|
@@ -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") {
|
|
@@ -4125,23 +4125,25 @@ function ComboBox({
|
|
|
4125
4125
|
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Input, { placeholder, render: /* @__PURE__ */ jsxRuntime.jsx(InputGroupInput, {}) }),
|
|
4126
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, {}) }) }) })
|
|
4127
4127
|
] }),
|
|
4128
|
-
/* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
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) => {
|
|
4135
4137
|
const item = normalizedItems.find((option) => option.value === value);
|
|
4136
4138
|
if (!item) {
|
|
4137
4139
|
return null;
|
|
4138
4140
|
}
|
|
4139
4141
|
return item.element ?? /* @__PURE__ */ jsxRuntime.jsx(ListItem, { value: item.value, children: item.label }, item.value);
|
|
4140
|
-
} })
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
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
|
+
) })
|
|
4145
4147
|
] })
|
|
4146
4148
|
}
|
|
4147
4149
|
);
|
|
@@ -4160,16 +4162,16 @@ function Modal({
|
|
|
4160
4162
|
...props
|
|
4161
4163
|
}) {
|
|
4162
4164
|
const { kind } = useOverlayTrigger();
|
|
4163
|
-
const popupClassName2 = cn("relative
|
|
4165
|
+
const popupClassName2 = cn("relative", placementClasses[placement], className);
|
|
4164
4166
|
if (kind === "alert-dialog") {
|
|
4165
4167
|
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
|
|
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 }) })
|
|
4168
4170
|
] });
|
|
4169
4171
|
}
|
|
4170
4172
|
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
|
|
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 }) })
|
|
4173
4175
|
] });
|
|
4174
4176
|
}
|
|
4175
4177
|
Modal.zenOverlayType = "dialog";
|
|
@@ -4874,12 +4876,12 @@ function Popover({
|
|
|
4874
4876
|
onOpenChange: _onOpenChange,
|
|
4875
4877
|
...props
|
|
4876
4878
|
}) {
|
|
4877
|
-
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(
|
|
4878
4880
|
popover.Popover.Popup,
|
|
4879
4881
|
{
|
|
4880
4882
|
className: cn(
|
|
4881
4883
|
"zen-popover outline-none",
|
|
4882
|
-
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",
|
|
4883
4885
|
className
|
|
4884
4886
|
),
|
|
4885
4887
|
children
|
|
@@ -5054,23 +5056,32 @@ function Tooltip({
|
|
|
5054
5056
|
showArrow,
|
|
5055
5057
|
...props
|
|
5056
5058
|
}) {
|
|
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
|
-
|
|
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
|
+
) });
|
|
5074
5085
|
}
|
|
5075
5086
|
function TooltipBubble({
|
|
5076
5087
|
children,
|
|
@@ -5096,7 +5107,7 @@ function FloatingTooltip({ className, style, children, ...props }) {
|
|
|
5096
5107
|
{
|
|
5097
5108
|
...props,
|
|
5098
5109
|
className: cn(
|
|
5099
|
-
"fixed pointer-events-none
|
|
5110
|
+
"zen-layer-floating fixed pointer-events-none -translate-x-1/2 -translate-y-[calc(100%+10px)]",
|
|
5100
5111
|
className
|
|
5101
5112
|
),
|
|
5102
5113
|
style: { ...style, left: position.x, top: position.y },
|
|
@@ -5373,7 +5384,7 @@ function HoverTrigger({
|
|
|
5373
5384
|
render: /* @__PURE__ */ jsxRuntime.jsx("span", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: triggerElement })
|
|
5374
5385
|
}
|
|
5375
5386
|
),
|
|
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 }) }) }) }) })
|
|
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 }) }) }) }) })
|
|
5377
5388
|
] });
|
|
5378
5389
|
}
|
|
5379
5390
|
var breakpoints = {
|
|
@@ -5605,7 +5616,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5605
5616
|
Column,
|
|
5606
5617
|
{
|
|
5607
5618
|
gap: "2",
|
|
5608
|
-
className: cn("fixed
|
|
5619
|
+
className: cn("zen-layer-toast fixed", positionClasses[position]),
|
|
5609
5620
|
onMouseEnter: () => setHovered(true),
|
|
5610
5621
|
onMouseLeave: () => setHovered(false),
|
|
5611
5622
|
children: transitions((style, item) => {
|
|
@@ -5770,10 +5781,17 @@ function Menu({
|
|
|
5770
5781
|
);
|
|
5771
5782
|
const popupContent = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { selected, select }, children });
|
|
5772
5783
|
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 }) }) });
|
|
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 }) }) });
|
|
5774
5785
|
}
|
|
5775
5786
|
if (primitiveKind === "menu") {
|
|
5776
|
-
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
|
+
) });
|
|
5777
5795
|
}
|
|
5778
5796
|
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { selected, select }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, role: "menu", className: popupClassName2, children }) });
|
|
5779
5797
|
}
|
|
@@ -6035,7 +6053,7 @@ function Navbar({
|
|
|
6035
6053
|
/* @__PURE__ */ jsxRuntime.jsx(navigationMenu.NavigationMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6036
6054
|
navigationMenu.NavigationMenu.Positioner,
|
|
6037
6055
|
{
|
|
6038
|
-
className: positionerClassName,
|
|
6056
|
+
className: cn("zen-layer-floating", positionerClassName),
|
|
6039
6057
|
sideOffset: 10,
|
|
6040
6058
|
collisionPadding: 16,
|
|
6041
6059
|
style: {
|
|
@@ -6600,6 +6618,24 @@ function SearchField({
|
|
|
6600
6618
|
] })
|
|
6601
6619
|
] });
|
|
6602
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
|
+
}
|
|
6603
6639
|
function Select({
|
|
6604
6640
|
value,
|
|
6605
6641
|
defaultValue,
|
|
@@ -6666,7 +6702,7 @@ function Select({
|
|
|
6666
6702
|
),
|
|
6667
6703
|
children: [
|
|
6668
6704
|
/* @__PURE__ */ jsxRuntime.jsx(select.Select.Value, { placeholder, children: (selected) => {
|
|
6669
|
-
const defaultChildren = selected ??
|
|
6705
|
+
const defaultChildren = selected == null ? placeholder : getSelectItemLabel(collection, selected) ?? selected;
|
|
6670
6706
|
return typeof renderValue === "function" ? renderValue({
|
|
6671
6707
|
defaultChildren,
|
|
6672
6708
|
isPlaceholder: selected == null
|
|
@@ -6683,12 +6719,13 @@ function Select({
|
|
|
6683
6719
|
sideOffset: 4,
|
|
6684
6720
|
alignItemWithTrigger,
|
|
6685
6721
|
...popoverProps,
|
|
6722
|
+
className: cn("zen-layer-floating", popoverProps?.className),
|
|
6686
6723
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6687
6724
|
select.Select.Popup,
|
|
6688
6725
|
{
|
|
6689
6726
|
className: cn(
|
|
6690
6727
|
"zen-popover bg-surface-overlay border border-edge rounded-md shadow-lg outline-none",
|
|
6691
|
-
isFullscreen && "zen-popover-fullscreen fixed inset-0 rounded-none
|
|
6728
|
+
isFullscreen && "zen-popover-fullscreen fixed inset-0 rounded-none"
|
|
6692
6729
|
),
|
|
6693
6730
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "2", padding: "2", children: [
|
|
6694
6731
|
allowSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6761,12 +6798,12 @@ function Sheet({
|
|
|
6761
6798
|
...style
|
|
6762
6799
|
};
|
|
6763
6800
|
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
|
|
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(
|
|
6766
6803
|
dialog.Dialog.Popup,
|
|
6767
6804
|
{
|
|
6768
6805
|
className: cn(
|
|
6769
|
-
"relative
|
|
6806
|
+
"relative p-6 overflow-auto outline-none",
|
|
6770
6807
|
"bg-surface-base border-edge shadow-xl",
|
|
6771
6808
|
sideClasses[side],
|
|
6772
6809
|
className
|