@nori-ui/core 1.2.0 → 1.3.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/chunk-2PESUXE3.js +3 -0
- package/dist/chunk-2PESUXE3.js.map +1 -0
- package/dist/{chunk-WDNDTSNX.js → chunk-4I37QSEM.js} +3 -3
- package/dist/{chunk-WDNDTSNX.js.map → chunk-4I37QSEM.js.map} +1 -1
- package/dist/chunk-H7MFAFV4.js +303 -0
- package/dist/chunk-H7MFAFV4.js.map +1 -0
- package/dist/chunk-KCLWPSV5.js +134 -0
- package/dist/chunk-KCLWPSV5.js.map +1 -0
- package/dist/{chunk-7D2BHQ6M.js → chunk-L5X4SYJ4.js} +3 -3
- package/dist/chunk-L5X4SYJ4.js.map +1 -0
- package/dist/{chunk-Y4ZRSW35.js → chunk-OCHEPOOO.js} +3 -3
- package/dist/{chunk-Y4ZRSW35.js.map → chunk-OCHEPOOO.js.map} +1 -1
- package/dist/{chunk-VMAGFYHG.js → chunk-SJZTETUT.js} +3 -3
- package/dist/{chunk-VMAGFYHG.js.map → chunk-SJZTETUT.js.map} +1 -1
- package/dist/{chunk-XBNVKPJN.js → chunk-XXBN6CIK.js} +3 -3
- package/dist/{chunk-XBNVKPJN.js.map → chunk-XXBN6CIK.js.map} +1 -1
- package/dist/chunk-ZPUYNM37.js +3 -0
- package/dist/chunk-ZPUYNM37.js.map +1 -0
- package/dist/client.cjs +418 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +18 -14
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/index.js +2 -2
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.js +3 -2
- package/dist/components/ContextMenu/index.cjs +1150 -0
- package/dist/components/ContextMenu/index.cjs.map +1 -0
- package/dist/components/ContextMenu/index.d.cts +38 -0
- package/dist/components/ContextMenu/index.d.ts +38 -0
- package/dist/components/ContextMenu/index.js +10 -0
- package/dist/components/ContextMenu/index.js.map +1 -0
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.js +3 -2
- package/dist/components/DropdownMenu/index.cjs +1032 -0
- package/dist/components/DropdownMenu/index.cjs.map +1 -0
- package/dist/components/DropdownMenu/index.d.cts +97 -0
- package/dist/components/DropdownMenu/index.d.ts +97 -0
- package/dist/components/DropdownMenu/index.js +10 -0
- package/dist/components/DropdownMenu/index.js.map +1 -0
- package/dist/components/Popover/index.cjs +1 -0
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts +22 -1
- package/dist/components/Popover/index.d.ts +22 -1
- package/dist/components/Popover/index.js +2 -1
- package/dist/components/Switch/index.js +2 -2
- package/dist/index.cjs +418 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +18 -14
- package/package.json +1 -1
- package/dist/chunk-7D2BHQ6M.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -6590,6 +6590,417 @@ var Checkbox = /* @__PURE__ */ __name(({
|
|
|
6590
6590
|
}
|
|
6591
6591
|
);
|
|
6592
6592
|
}, "Checkbox");
|
|
6593
|
+
var MenuContext = React.createContext(null);
|
|
6594
|
+
var MenuContextProvider = /* @__PURE__ */ __name(({
|
|
6595
|
+
open,
|
|
6596
|
+
toggle,
|
|
6597
|
+
close,
|
|
6598
|
+
children
|
|
6599
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { open, toggle: toggle ?? close, close }, children }), "MenuContextProvider");
|
|
6600
|
+
function useMenuContext(caller) {
|
|
6601
|
+
const ctx = React.useContext(MenuContext);
|
|
6602
|
+
if (!ctx) {
|
|
6603
|
+
throw new Error(`<${caller}> must be rendered inside a <DropdownMenu> or <ContextMenu>.`);
|
|
6604
|
+
}
|
|
6605
|
+
return ctx;
|
|
6606
|
+
}
|
|
6607
|
+
__name(useMenuContext, "useMenuContext");
|
|
6608
|
+
var MenuContent = /* @__PURE__ */ __name(({
|
|
6609
|
+
children,
|
|
6610
|
+
className,
|
|
6611
|
+
testID,
|
|
6612
|
+
side = "bottom",
|
|
6613
|
+
align = "start",
|
|
6614
|
+
"aria-label": ariaLabel
|
|
6615
|
+
}) => {
|
|
6616
|
+
const colors = useThemeColors();
|
|
6617
|
+
const containerRef = React.useRef(null);
|
|
6618
|
+
React.useEffect(() => {
|
|
6619
|
+
if (reactNative.Platform.OS !== "web") {
|
|
6620
|
+
return;
|
|
6621
|
+
}
|
|
6622
|
+
if (typeof document === "undefined") {
|
|
6623
|
+
return;
|
|
6624
|
+
}
|
|
6625
|
+
const container = containerRef.current;
|
|
6626
|
+
if (!container) {
|
|
6627
|
+
return;
|
|
6628
|
+
}
|
|
6629
|
+
const getItems = /* @__PURE__ */ __name(() => Array.from(container.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')), "getItems");
|
|
6630
|
+
const onKeyDown = /* @__PURE__ */ __name((e) => {
|
|
6631
|
+
const items = getItems();
|
|
6632
|
+
if (items.length === 0) {
|
|
6633
|
+
return;
|
|
6634
|
+
}
|
|
6635
|
+
const focused = document.activeElement;
|
|
6636
|
+
const idx = focused ? items.indexOf(focused) : -1;
|
|
6637
|
+
switch (e.key) {
|
|
6638
|
+
case "ArrowDown":
|
|
6639
|
+
e.preventDefault();
|
|
6640
|
+
items[idx < items.length - 1 ? idx + 1 : 0]?.focus();
|
|
6641
|
+
break;
|
|
6642
|
+
case "ArrowUp":
|
|
6643
|
+
e.preventDefault();
|
|
6644
|
+
items[idx > 0 ? idx - 1 : items.length - 1]?.focus();
|
|
6645
|
+
break;
|
|
6646
|
+
case "Home":
|
|
6647
|
+
e.preventDefault();
|
|
6648
|
+
items[0]?.focus();
|
|
6649
|
+
break;
|
|
6650
|
+
case "End":
|
|
6651
|
+
e.preventDefault();
|
|
6652
|
+
items[items.length - 1]?.focus();
|
|
6653
|
+
break;
|
|
6654
|
+
}
|
|
6655
|
+
}, "onKeyDown");
|
|
6656
|
+
container.addEventListener("keydown", onKeyDown);
|
|
6657
|
+
return () => container.removeEventListener("keydown", onKeyDown);
|
|
6658
|
+
});
|
|
6659
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6660
|
+
Popover.Content,
|
|
6661
|
+
{
|
|
6662
|
+
side,
|
|
6663
|
+
align,
|
|
6664
|
+
...testID !== void 0 ? { testID } : {},
|
|
6665
|
+
...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {},
|
|
6666
|
+
...className !== void 0 ? { className } : {},
|
|
6667
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6668
|
+
reactNative.View,
|
|
6669
|
+
{
|
|
6670
|
+
ref: containerRef,
|
|
6671
|
+
...{
|
|
6672
|
+
role: "menu",
|
|
6673
|
+
...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {}
|
|
6674
|
+
},
|
|
6675
|
+
style: {
|
|
6676
|
+
minWidth: 160,
|
|
6677
|
+
paddingVertical: px(colors.spacing["1"]),
|
|
6678
|
+
margin: -px(colors.spacing["4"]),
|
|
6679
|
+
borderRadius: px(colors.radius.lg),
|
|
6680
|
+
overflow: "hidden"
|
|
6681
|
+
},
|
|
6682
|
+
children
|
|
6683
|
+
}
|
|
6684
|
+
)
|
|
6685
|
+
}
|
|
6686
|
+
);
|
|
6687
|
+
}, "MenuContent");
|
|
6688
|
+
MenuContent.displayName = "MenuContent";
|
|
6689
|
+
var MenuItem = /* @__PURE__ */ __name(({
|
|
6690
|
+
onSelect,
|
|
6691
|
+
disabled = false,
|
|
6692
|
+
destructive = false,
|
|
6693
|
+
icon,
|
|
6694
|
+
shortcut,
|
|
6695
|
+
children,
|
|
6696
|
+
className,
|
|
6697
|
+
testID
|
|
6698
|
+
}) => {
|
|
6699
|
+
const colors = useThemeColors();
|
|
6700
|
+
const menu = useMenuContext("MenuItem");
|
|
6701
|
+
const handlePress = React.useCallback(() => {
|
|
6702
|
+
if (disabled) {
|
|
6703
|
+
return;
|
|
6704
|
+
}
|
|
6705
|
+
onSelect?.();
|
|
6706
|
+
menu.close();
|
|
6707
|
+
}, [disabled, onSelect, menu]);
|
|
6708
|
+
const textColor = destructive ? colors.color.danger : disabled ? colors.semantic.text.muted : colors.semantic.text.default;
|
|
6709
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6710
|
+
reactNative.Pressable,
|
|
6711
|
+
{
|
|
6712
|
+
onPress: handlePress,
|
|
6713
|
+
disabled,
|
|
6714
|
+
...{
|
|
6715
|
+
role: "menuitem",
|
|
6716
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
6717
|
+
tabIndex: disabled ? -1 : 0,
|
|
6718
|
+
onKeyDown: /* @__PURE__ */ __name((e) => {
|
|
6719
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6720
|
+
e.preventDefault();
|
|
6721
|
+
handlePress();
|
|
6722
|
+
}
|
|
6723
|
+
}, "onKeyDown")
|
|
6724
|
+
},
|
|
6725
|
+
...testID !== void 0 ? { testID } : {},
|
|
6726
|
+
className: cn("flex-row items-center gap-2 px-3 py-2", className),
|
|
6727
|
+
style: { opacity: disabled ? 0.4 : 1 },
|
|
6728
|
+
accessibilityRole: "menuitem",
|
|
6729
|
+
accessibilityState: { disabled },
|
|
6730
|
+
children: [
|
|
6731
|
+
icon !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { width: 16, height: 16, alignItems: "center", justifyContent: "center" }, children: icon }),
|
|
6732
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6733
|
+
reactNative.Text,
|
|
6734
|
+
{
|
|
6735
|
+
style: {
|
|
6736
|
+
flex: 1,
|
|
6737
|
+
fontFamily: colors.fontFamily.body,
|
|
6738
|
+
fontSize: px(colors.fontSize.sm),
|
|
6739
|
+
color: textColor
|
|
6740
|
+
},
|
|
6741
|
+
children
|
|
6742
|
+
}
|
|
6743
|
+
),
|
|
6744
|
+
shortcut !== void 0 && reactNative.Platform.OS === "web" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6745
|
+
reactNative.Text,
|
|
6746
|
+
{
|
|
6747
|
+
...{ "aria-hidden": "true" },
|
|
6748
|
+
style: {
|
|
6749
|
+
fontFamily: colors.fontFamily.body,
|
|
6750
|
+
fontSize: px(colors.fontSize.xs),
|
|
6751
|
+
color: colors.semantic.text.muted
|
|
6752
|
+
},
|
|
6753
|
+
children: shortcut
|
|
6754
|
+
}
|
|
6755
|
+
)
|
|
6756
|
+
]
|
|
6757
|
+
}
|
|
6758
|
+
);
|
|
6759
|
+
}, "MenuItem");
|
|
6760
|
+
MenuItem.displayName = "MenuItem";
|
|
6761
|
+
var MenuSeparator = /* @__PURE__ */ __name(({ className, testID }) => {
|
|
6762
|
+
const colors = useThemeColors();
|
|
6763
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6764
|
+
reactNative.View,
|
|
6765
|
+
{
|
|
6766
|
+
...{ role: "separator" },
|
|
6767
|
+
accessibilityRole: "none",
|
|
6768
|
+
...testID !== void 0 ? { testID } : {},
|
|
6769
|
+
className: cn("mx-1 my-1", className),
|
|
6770
|
+
style: {
|
|
6771
|
+
height: 1,
|
|
6772
|
+
marginVertical: 4,
|
|
6773
|
+
marginHorizontal: 4,
|
|
6774
|
+
backgroundColor: colors.semantic.border.default
|
|
6775
|
+
}
|
|
6776
|
+
}
|
|
6777
|
+
);
|
|
6778
|
+
}, "MenuSeparator");
|
|
6779
|
+
MenuSeparator.displayName = "MenuSeparator";
|
|
6780
|
+
var MenuLabel = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
6781
|
+
const colors = useThemeColors();
|
|
6782
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6783
|
+
reactNative.View,
|
|
6784
|
+
{
|
|
6785
|
+
...{ role: "presentation" },
|
|
6786
|
+
...testID !== void 0 ? { testID } : {},
|
|
6787
|
+
className: cn("px-3 pt-2 pb-1", className),
|
|
6788
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6789
|
+
reactNative.Text,
|
|
6790
|
+
{
|
|
6791
|
+
style: {
|
|
6792
|
+
fontFamily: colors.fontFamily.body,
|
|
6793
|
+
fontSize: px(colors.fontSize.xs),
|
|
6794
|
+
color: colors.semantic.text.muted,
|
|
6795
|
+
textTransform: "uppercase",
|
|
6796
|
+
letterSpacing: 0.6,
|
|
6797
|
+
fontWeight: "600"
|
|
6798
|
+
},
|
|
6799
|
+
children
|
|
6800
|
+
}
|
|
6801
|
+
)
|
|
6802
|
+
}
|
|
6803
|
+
);
|
|
6804
|
+
}, "MenuLabel");
|
|
6805
|
+
MenuLabel.displayName = "MenuLabel";
|
|
6806
|
+
var DropdownMenuRoot = /* @__PURE__ */ __name(({ open, defaultOpen = false, onOpenChange, children }) => {
|
|
6807
|
+
const [inner, setInner] = React.useState(defaultOpen);
|
|
6808
|
+
const isControlled = open !== void 0;
|
|
6809
|
+
const current = isControlled ? open : inner;
|
|
6810
|
+
const setOpen = React.useCallback(
|
|
6811
|
+
(next) => {
|
|
6812
|
+
if (!isControlled) {
|
|
6813
|
+
setInner(next);
|
|
6814
|
+
}
|
|
6815
|
+
onOpenChange?.(next);
|
|
6816
|
+
},
|
|
6817
|
+
[isControlled, onOpenChange]
|
|
6818
|
+
);
|
|
6819
|
+
const toggle = React.useCallback(() => setOpen(!current), [setOpen, current]);
|
|
6820
|
+
const close = React.useCallback(() => setOpen(false), [setOpen]);
|
|
6821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuContextProvider, { open: current, toggle, close, children: /* @__PURE__ */ jsxRuntime.jsx(Popover, { open: current, onOpenChange: setOpen, children }) });
|
|
6822
|
+
}, "DropdownMenuRoot");
|
|
6823
|
+
var DropdownMenuTrigger = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
6824
|
+
const menu = useMenuContext("DropdownMenu.Trigger");
|
|
6825
|
+
const popover = usePopoverContext("DropdownMenu.Trigger");
|
|
6826
|
+
const onPress = React.useCallback(() => {
|
|
6827
|
+
popover.measureTrigger();
|
|
6828
|
+
popover.setOpen(!popover.open);
|
|
6829
|
+
}, [popover]);
|
|
6830
|
+
if (React.isValidElement(children)) {
|
|
6831
|
+
const child = children;
|
|
6832
|
+
const fire = /* @__PURE__ */ __name((existing) => (event) => {
|
|
6833
|
+
existing?.(event);
|
|
6834
|
+
popover.measureTrigger();
|
|
6835
|
+
popover.setOpen(!popover.open);
|
|
6836
|
+
}, "fire");
|
|
6837
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6838
|
+
Slot,
|
|
6839
|
+
{
|
|
6840
|
+
ref: (node) => {
|
|
6841
|
+
popover.triggerRef.current = node;
|
|
6842
|
+
},
|
|
6843
|
+
onClick: fire(child.props.onClick),
|
|
6844
|
+
onPress: fire(child.props.onPress),
|
|
6845
|
+
...{
|
|
6846
|
+
"aria-haspopup": "menu",
|
|
6847
|
+
"aria-expanded": menu.open,
|
|
6848
|
+
"aria-controls": popover.contentId
|
|
6849
|
+
},
|
|
6850
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
6851
|
+
...className !== void 0 ? { className } : {},
|
|
6852
|
+
children: child
|
|
6853
|
+
}
|
|
6854
|
+
);
|
|
6855
|
+
}
|
|
6856
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6857
|
+
reactNative.Pressable,
|
|
6858
|
+
{
|
|
6859
|
+
ref: (node) => {
|
|
6860
|
+
popover.triggerRef.current = node;
|
|
6861
|
+
},
|
|
6862
|
+
onPress,
|
|
6863
|
+
...{
|
|
6864
|
+
"aria-haspopup": "menu",
|
|
6865
|
+
"aria-expanded": menu.open,
|
|
6866
|
+
"aria-controls": popover.contentId
|
|
6867
|
+
},
|
|
6868
|
+
...testID !== void 0 ? { testID } : {},
|
|
6869
|
+
...className !== void 0 ? { className } : {},
|
|
6870
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children }) : children
|
|
6871
|
+
}
|
|
6872
|
+
);
|
|
6873
|
+
}, "DropdownMenuTrigger");
|
|
6874
|
+
var DropdownMenuContent = /* @__PURE__ */ __name((props) => /* @__PURE__ */ jsxRuntime.jsx(MenuContent, { ...props }), "DropdownMenuContent");
|
|
6875
|
+
var DropdownMenu = Object.assign(DropdownMenuRoot, {
|
|
6876
|
+
Trigger: DropdownMenuTrigger,
|
|
6877
|
+
Content: DropdownMenuContent,
|
|
6878
|
+
Item: MenuItem,
|
|
6879
|
+
Separator: MenuSeparator,
|
|
6880
|
+
Label: MenuLabel
|
|
6881
|
+
});
|
|
6882
|
+
var ContextMenuCtx = React.createContext(null);
|
|
6883
|
+
var useContextMenuCtx = /* @__PURE__ */ __name(() => {
|
|
6884
|
+
const ctx = React.useContext(ContextMenuCtx);
|
|
6885
|
+
if (!ctx) {
|
|
6886
|
+
throw new Error("ContextMenu compound parts must be rendered inside a <ContextMenu>.");
|
|
6887
|
+
}
|
|
6888
|
+
return ctx;
|
|
6889
|
+
}, "useContextMenuCtx");
|
|
6890
|
+
var ContextMenuRoot = /* @__PURE__ */ __name(({ open, defaultOpen = false, onOpenChange, children }) => {
|
|
6891
|
+
const [inner, setInner] = React.useState(defaultOpen);
|
|
6892
|
+
const isControlled = open !== void 0;
|
|
6893
|
+
const current = isControlled ? open : inner;
|
|
6894
|
+
const setOpen = React.useCallback(
|
|
6895
|
+
(next) => {
|
|
6896
|
+
if (!isControlled) {
|
|
6897
|
+
setInner(next);
|
|
6898
|
+
}
|
|
6899
|
+
onOpenChange?.(next);
|
|
6900
|
+
},
|
|
6901
|
+
[isControlled, onOpenChange]
|
|
6902
|
+
);
|
|
6903
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuCtx.Provider, { value: { open: current, setOpen }, children: /* @__PURE__ */ jsxRuntime.jsx(Popover, { open: current, onOpenChange: setOpen, children }) });
|
|
6904
|
+
}, "ContextMenuRoot");
|
|
6905
|
+
var ContextMenuTrigger = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
6906
|
+
const ctx = useContextMenuCtx();
|
|
6907
|
+
const popover = usePopoverContext("ContextMenu.Trigger");
|
|
6908
|
+
const openMenu = React.useCallback(() => {
|
|
6909
|
+
popover.measureTrigger();
|
|
6910
|
+
ctx.setOpen(true);
|
|
6911
|
+
}, [ctx, popover]);
|
|
6912
|
+
if (reactNative.Platform.OS === "web") {
|
|
6913
|
+
if (React.isValidElement(children)) {
|
|
6914
|
+
const child = children;
|
|
6915
|
+
const existing = child.props.onContextMenu;
|
|
6916
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6917
|
+
Slot,
|
|
6918
|
+
{
|
|
6919
|
+
ref: (node) => {
|
|
6920
|
+
popover.triggerRef.current = node;
|
|
6921
|
+
},
|
|
6922
|
+
onContextMenu: (e) => {
|
|
6923
|
+
e.preventDefault();
|
|
6924
|
+
existing?.(e);
|
|
6925
|
+
openMenu();
|
|
6926
|
+
},
|
|
6927
|
+
...{
|
|
6928
|
+
"aria-haspopup": "menu",
|
|
6929
|
+
"aria-expanded": ctx.open,
|
|
6930
|
+
"aria-controls": popover.contentId
|
|
6931
|
+
},
|
|
6932
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
6933
|
+
...className !== void 0 ? { className } : {},
|
|
6934
|
+
children: child
|
|
6935
|
+
}
|
|
6936
|
+
);
|
|
6937
|
+
}
|
|
6938
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6939
|
+
reactNative.Pressable,
|
|
6940
|
+
{
|
|
6941
|
+
ref: (node) => {
|
|
6942
|
+
popover.triggerRef.current = node;
|
|
6943
|
+
},
|
|
6944
|
+
...{
|
|
6945
|
+
onContextMenu: /* @__PURE__ */ __name((e) => {
|
|
6946
|
+
e.preventDefault();
|
|
6947
|
+
openMenu();
|
|
6948
|
+
}, "onContextMenu"),
|
|
6949
|
+
"aria-haspopup": "menu",
|
|
6950
|
+
"aria-expanded": ctx.open,
|
|
6951
|
+
"aria-controls": popover.contentId
|
|
6952
|
+
},
|
|
6953
|
+
...testID !== void 0 ? { testID } : {},
|
|
6954
|
+
...className !== void 0 ? { className } : {},
|
|
6955
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children }) : children
|
|
6956
|
+
}
|
|
6957
|
+
);
|
|
6958
|
+
}
|
|
6959
|
+
if (React.isValidElement(children)) {
|
|
6960
|
+
const child = children;
|
|
6961
|
+
const existing = child.props.onLongPress;
|
|
6962
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6963
|
+
Slot,
|
|
6964
|
+
{
|
|
6965
|
+
ref: (node) => {
|
|
6966
|
+
popover.triggerRef.current = node;
|
|
6967
|
+
},
|
|
6968
|
+
onLongPress: (e) => {
|
|
6969
|
+
existing?.(e);
|
|
6970
|
+
openMenu();
|
|
6971
|
+
},
|
|
6972
|
+
accessibilityRole: "button",
|
|
6973
|
+
...testID !== void 0 ? { testID } : {},
|
|
6974
|
+
...className !== void 0 ? { className } : {},
|
|
6975
|
+
children: child
|
|
6976
|
+
}
|
|
6977
|
+
);
|
|
6978
|
+
}
|
|
6979
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6980
|
+
reactNative.Pressable,
|
|
6981
|
+
{
|
|
6982
|
+
ref: (node) => {
|
|
6983
|
+
popover.triggerRef.current = node;
|
|
6984
|
+
},
|
|
6985
|
+
onLongPress: openMenu,
|
|
6986
|
+
...testID !== void 0 ? { testID } : {},
|
|
6987
|
+
...className !== void 0 ? { className } : {},
|
|
6988
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children }) : children
|
|
6989
|
+
}
|
|
6990
|
+
);
|
|
6991
|
+
}, "ContextMenuTrigger");
|
|
6992
|
+
var ContextMenuContent = /* @__PURE__ */ __name((props) => {
|
|
6993
|
+
const ctx = useContextMenuCtx();
|
|
6994
|
+
const close = React.useCallback(() => ctx.setOpen(false), [ctx]);
|
|
6995
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuContextProvider, { open: ctx.open, close, children: /* @__PURE__ */ jsxRuntime.jsx(MenuContent, { ...props }) });
|
|
6996
|
+
}, "ContextMenuContent");
|
|
6997
|
+
var ContextMenu = Object.assign(ContextMenuRoot, {
|
|
6998
|
+
Trigger: ContextMenuTrigger,
|
|
6999
|
+
Content: ContextMenuContent,
|
|
7000
|
+
Item: MenuItem,
|
|
7001
|
+
Separator: MenuSeparator,
|
|
7002
|
+
Label: MenuLabel
|
|
7003
|
+
});
|
|
6593
7004
|
function formatDate(date$1, locale) {
|
|
6594
7005
|
try {
|
|
6595
7006
|
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date$1.toDate(date.getLocalTimeZone()));
|
|
@@ -12461,14 +12872,20 @@ exports.Button = Button;
|
|
|
12461
12872
|
exports.Calendar = Calendar;
|
|
12462
12873
|
exports.Card = Card;
|
|
12463
12874
|
exports.Checkbox = Checkbox;
|
|
12875
|
+
exports.ContextMenu = ContextMenu;
|
|
12464
12876
|
exports.DatePicker = DatePicker;
|
|
12465
12877
|
exports.Dialog = Dialog;
|
|
12878
|
+
exports.DropdownMenu = DropdownMenu;
|
|
12466
12879
|
exports.Field = Field;
|
|
12467
12880
|
exports.FloatButton = FloatButton;
|
|
12468
12881
|
exports.HStack = HStack;
|
|
12469
12882
|
exports.Icon = Icon;
|
|
12470
12883
|
exports.InputGroup = InputGroup;
|
|
12471
12884
|
exports.Label = Label;
|
|
12885
|
+
exports.MenuContent = MenuContent;
|
|
12886
|
+
exports.MenuItem = MenuItem;
|
|
12887
|
+
exports.MenuLabel = MenuLabel;
|
|
12888
|
+
exports.MenuSeparator = MenuSeparator;
|
|
12472
12889
|
exports.PAGINATION_COMPACT_BREAKPOINT = PAGINATION_COMPACT_BREAKPOINT;
|
|
12473
12890
|
exports.Pagination = Pagination;
|
|
12474
12891
|
exports.Popover = Popover;
|
|
@@ -12502,6 +12919,7 @@ exports.themeDark = themeDark;
|
|
|
12502
12919
|
exports.toast = toast2;
|
|
12503
12920
|
exports.useCalendarCaption = useCalendarCaption;
|
|
12504
12921
|
exports.usePagination = usePagination;
|
|
12922
|
+
exports.usePopoverContext = usePopoverContext;
|
|
12505
12923
|
exports.useSliderInteractionActive = useSliderInteractionActive;
|
|
12506
12924
|
//# sourceMappingURL=index.cjs.map
|
|
12507
12925
|
//# sourceMappingURL=index.cjs.map
|