@nori-ui/core 1.1.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.
Files changed (58) hide show
  1. package/dist/chunk-2PESUXE3.js +3 -0
  2. package/dist/chunk-2PESUXE3.js.map +1 -0
  3. package/dist/{chunk-WDNDTSNX.js → chunk-4I37QSEM.js} +3 -3
  4. package/dist/{chunk-WDNDTSNX.js.map → chunk-4I37QSEM.js.map} +1 -1
  5. package/dist/chunk-H7MFAFV4.js +303 -0
  6. package/dist/chunk-H7MFAFV4.js.map +1 -0
  7. package/dist/chunk-KCLWPSV5.js +134 -0
  8. package/dist/chunk-KCLWPSV5.js.map +1 -0
  9. package/dist/{chunk-7D2BHQ6M.js → chunk-L5X4SYJ4.js} +3 -3
  10. package/dist/chunk-L5X4SYJ4.js.map +1 -0
  11. package/dist/{chunk-Y4ZRSW35.js → chunk-OCHEPOOO.js} +3 -3
  12. package/dist/{chunk-Y4ZRSW35.js.map → chunk-OCHEPOOO.js.map} +1 -1
  13. package/dist/{chunk-VMAGFYHG.js → chunk-SJZTETUT.js} +3 -3
  14. package/dist/{chunk-VMAGFYHG.js.map → chunk-SJZTETUT.js.map} +1 -1
  15. package/dist/chunk-XXBN6CIK.js +343 -0
  16. package/dist/chunk-XXBN6CIK.js.map +1 -0
  17. package/dist/chunk-ZPUYNM37.js +3 -0
  18. package/dist/chunk-ZPUYNM37.js.map +1 -0
  19. package/dist/client.cjs +747 -0
  20. package/dist/client.cjs.map +1 -1
  21. package/dist/client.d.cts +4 -1
  22. package/dist/client.d.ts +4 -1
  23. package/dist/client.js +24 -19
  24. package/dist/client.js.map +1 -1
  25. package/dist/components/Accordion/index.js +2 -2
  26. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  27. package/dist/components/Breadcrumb/index.js +3 -2
  28. package/dist/components/ContextMenu/index.cjs +1150 -0
  29. package/dist/components/ContextMenu/index.cjs.map +1 -0
  30. package/dist/components/ContextMenu/index.d.cts +38 -0
  31. package/dist/components/ContextMenu/index.d.ts +38 -0
  32. package/dist/components/ContextMenu/index.js +10 -0
  33. package/dist/components/ContextMenu/index.js.map +1 -0
  34. package/dist/components/DatePicker/index.cjs +3875 -0
  35. package/dist/components/DatePicker/index.cjs.map +1 -0
  36. package/dist/components/DatePicker/index.d.cts +58 -0
  37. package/dist/components/DatePicker/index.d.ts +58 -0
  38. package/dist/components/DatePicker/index.js +15 -0
  39. package/dist/components/DatePicker/index.js.map +1 -0
  40. package/dist/components/DropdownMenu/index.cjs +1032 -0
  41. package/dist/components/DropdownMenu/index.cjs.map +1 -0
  42. package/dist/components/DropdownMenu/index.d.cts +97 -0
  43. package/dist/components/DropdownMenu/index.d.ts +97 -0
  44. package/dist/components/DropdownMenu/index.js +10 -0
  45. package/dist/components/DropdownMenu/index.js.map +1 -0
  46. package/dist/components/Popover/index.cjs +1 -0
  47. package/dist/components/Popover/index.cjs.map +1 -1
  48. package/dist/components/Popover/index.d.cts +22 -1
  49. package/dist/components/Popover/index.d.ts +22 -1
  50. package/dist/components/Popover/index.js +2 -1
  51. package/dist/components/Switch/index.js +2 -2
  52. package/dist/index.cjs +747 -0
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.cts +4 -1
  55. package/dist/index.d.ts +4 -1
  56. package/dist/index.js +23 -18
  57. package/package.json +1 -1
  58. package/dist/chunk-7D2BHQ6M.js.map +0 -1
package/dist/client.cjs CHANGED
@@ -6611,6 +6611,745 @@ var Checkbox = /* @__PURE__ */ __name(({
6611
6611
  }
6612
6612
  );
6613
6613
  }, "Checkbox");
6614
+ var MenuContext = React.createContext(null);
6615
+ var MenuContextProvider = /* @__PURE__ */ __name(({
6616
+ open,
6617
+ toggle,
6618
+ close,
6619
+ children
6620
+ }) => /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: { open, toggle: toggle ?? close, close }, children }), "MenuContextProvider");
6621
+ function useMenuContext(caller) {
6622
+ const ctx = React.useContext(MenuContext);
6623
+ if (!ctx) {
6624
+ throw new Error(`<${caller}> must be rendered inside a <DropdownMenu> or <ContextMenu>.`);
6625
+ }
6626
+ return ctx;
6627
+ }
6628
+ __name(useMenuContext, "useMenuContext");
6629
+ var MenuContent = /* @__PURE__ */ __name(({
6630
+ children,
6631
+ className,
6632
+ testID,
6633
+ side = "bottom",
6634
+ align = "start",
6635
+ "aria-label": ariaLabel
6636
+ }) => {
6637
+ const colors = useThemeColors();
6638
+ const containerRef = React.useRef(null);
6639
+ React.useEffect(() => {
6640
+ if (reactNative.Platform.OS !== "web") {
6641
+ return;
6642
+ }
6643
+ if (typeof document === "undefined") {
6644
+ return;
6645
+ }
6646
+ const container = containerRef.current;
6647
+ if (!container) {
6648
+ return;
6649
+ }
6650
+ const getItems = /* @__PURE__ */ __name(() => Array.from(container.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')), "getItems");
6651
+ const onKeyDown = /* @__PURE__ */ __name((e) => {
6652
+ const items = getItems();
6653
+ if (items.length === 0) {
6654
+ return;
6655
+ }
6656
+ const focused = document.activeElement;
6657
+ const idx = focused ? items.indexOf(focused) : -1;
6658
+ switch (e.key) {
6659
+ case "ArrowDown":
6660
+ e.preventDefault();
6661
+ items[idx < items.length - 1 ? idx + 1 : 0]?.focus();
6662
+ break;
6663
+ case "ArrowUp":
6664
+ e.preventDefault();
6665
+ items[idx > 0 ? idx - 1 : items.length - 1]?.focus();
6666
+ break;
6667
+ case "Home":
6668
+ e.preventDefault();
6669
+ items[0]?.focus();
6670
+ break;
6671
+ case "End":
6672
+ e.preventDefault();
6673
+ items[items.length - 1]?.focus();
6674
+ break;
6675
+ }
6676
+ }, "onKeyDown");
6677
+ container.addEventListener("keydown", onKeyDown);
6678
+ return () => container.removeEventListener("keydown", onKeyDown);
6679
+ });
6680
+ return /* @__PURE__ */ jsxRuntime.jsx(
6681
+ Popover.Content,
6682
+ {
6683
+ side,
6684
+ align,
6685
+ ...testID !== void 0 ? { testID } : {},
6686
+ ...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {},
6687
+ ...className !== void 0 ? { className } : {},
6688
+ children: /* @__PURE__ */ jsxRuntime.jsx(
6689
+ reactNative.View,
6690
+ {
6691
+ ref: containerRef,
6692
+ ...{
6693
+ role: "menu",
6694
+ ...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {}
6695
+ },
6696
+ style: {
6697
+ minWidth: 160,
6698
+ paddingVertical: px(colors.spacing["1"]),
6699
+ margin: -px(colors.spacing["4"]),
6700
+ borderRadius: px(colors.radius.lg),
6701
+ overflow: "hidden"
6702
+ },
6703
+ children
6704
+ }
6705
+ )
6706
+ }
6707
+ );
6708
+ }, "MenuContent");
6709
+ MenuContent.displayName = "MenuContent";
6710
+ var MenuItem = /* @__PURE__ */ __name(({
6711
+ onSelect,
6712
+ disabled = false,
6713
+ destructive = false,
6714
+ icon,
6715
+ shortcut,
6716
+ children,
6717
+ className,
6718
+ testID
6719
+ }) => {
6720
+ const colors = useThemeColors();
6721
+ const menu = useMenuContext("MenuItem");
6722
+ const handlePress = React.useCallback(() => {
6723
+ if (disabled) {
6724
+ return;
6725
+ }
6726
+ onSelect?.();
6727
+ menu.close();
6728
+ }, [disabled, onSelect, menu]);
6729
+ const textColor = destructive ? colors.color.danger : disabled ? colors.semantic.text.muted : colors.semantic.text.default;
6730
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6731
+ reactNative.Pressable,
6732
+ {
6733
+ onPress: handlePress,
6734
+ disabled,
6735
+ ...{
6736
+ role: "menuitem",
6737
+ "aria-disabled": disabled ? "true" : void 0,
6738
+ tabIndex: disabled ? -1 : 0,
6739
+ onKeyDown: /* @__PURE__ */ __name((e) => {
6740
+ if (e.key === "Enter" || e.key === " ") {
6741
+ e.preventDefault();
6742
+ handlePress();
6743
+ }
6744
+ }, "onKeyDown")
6745
+ },
6746
+ ...testID !== void 0 ? { testID } : {},
6747
+ className: cn("flex-row items-center gap-2 px-3 py-2", className),
6748
+ style: { opacity: disabled ? 0.4 : 1 },
6749
+ accessibilityRole: "menuitem",
6750
+ accessibilityState: { disabled },
6751
+ children: [
6752
+ icon !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { width: 16, height: 16, alignItems: "center", justifyContent: "center" }, children: icon }),
6753
+ /* @__PURE__ */ jsxRuntime.jsx(
6754
+ reactNative.Text,
6755
+ {
6756
+ style: {
6757
+ flex: 1,
6758
+ fontFamily: colors.fontFamily.body,
6759
+ fontSize: px(colors.fontSize.sm),
6760
+ color: textColor
6761
+ },
6762
+ children
6763
+ }
6764
+ ),
6765
+ shortcut !== void 0 && reactNative.Platform.OS === "web" && /* @__PURE__ */ jsxRuntime.jsx(
6766
+ reactNative.Text,
6767
+ {
6768
+ ...{ "aria-hidden": "true" },
6769
+ style: {
6770
+ fontFamily: colors.fontFamily.body,
6771
+ fontSize: px(colors.fontSize.xs),
6772
+ color: colors.semantic.text.muted
6773
+ },
6774
+ children: shortcut
6775
+ }
6776
+ )
6777
+ ]
6778
+ }
6779
+ );
6780
+ }, "MenuItem");
6781
+ MenuItem.displayName = "MenuItem";
6782
+ var MenuSeparator = /* @__PURE__ */ __name(({ className, testID }) => {
6783
+ const colors = useThemeColors();
6784
+ return /* @__PURE__ */ jsxRuntime.jsx(
6785
+ reactNative.View,
6786
+ {
6787
+ ...{ role: "separator" },
6788
+ accessibilityRole: "none",
6789
+ ...testID !== void 0 ? { testID } : {},
6790
+ className: cn("mx-1 my-1", className),
6791
+ style: {
6792
+ height: 1,
6793
+ marginVertical: 4,
6794
+ marginHorizontal: 4,
6795
+ backgroundColor: colors.semantic.border.default
6796
+ }
6797
+ }
6798
+ );
6799
+ }, "MenuSeparator");
6800
+ MenuSeparator.displayName = "MenuSeparator";
6801
+ var MenuLabel = /* @__PURE__ */ __name(({ children, className, testID }) => {
6802
+ const colors = useThemeColors();
6803
+ return /* @__PURE__ */ jsxRuntime.jsx(
6804
+ reactNative.View,
6805
+ {
6806
+ ...{ role: "presentation" },
6807
+ ...testID !== void 0 ? { testID } : {},
6808
+ className: cn("px-3 pt-2 pb-1", className),
6809
+ children: /* @__PURE__ */ jsxRuntime.jsx(
6810
+ reactNative.Text,
6811
+ {
6812
+ style: {
6813
+ fontFamily: colors.fontFamily.body,
6814
+ fontSize: px(colors.fontSize.xs),
6815
+ color: colors.semantic.text.muted,
6816
+ textTransform: "uppercase",
6817
+ letterSpacing: 0.6,
6818
+ fontWeight: "600"
6819
+ },
6820
+ children
6821
+ }
6822
+ )
6823
+ }
6824
+ );
6825
+ }, "MenuLabel");
6826
+ MenuLabel.displayName = "MenuLabel";
6827
+ var DropdownMenuRoot = /* @__PURE__ */ __name(({ open, defaultOpen = false, onOpenChange, children }) => {
6828
+ const [inner, setInner] = React.useState(defaultOpen);
6829
+ const isControlled = open !== void 0;
6830
+ const current = isControlled ? open : inner;
6831
+ const setOpen = React.useCallback(
6832
+ (next) => {
6833
+ if (!isControlled) {
6834
+ setInner(next);
6835
+ }
6836
+ onOpenChange?.(next);
6837
+ },
6838
+ [isControlled, onOpenChange]
6839
+ );
6840
+ const toggle = React.useCallback(() => setOpen(!current), [setOpen, current]);
6841
+ const close = React.useCallback(() => setOpen(false), [setOpen]);
6842
+ return /* @__PURE__ */ jsxRuntime.jsx(MenuContextProvider, { open: current, toggle, close, children: /* @__PURE__ */ jsxRuntime.jsx(Popover, { open: current, onOpenChange: setOpen, children }) });
6843
+ }, "DropdownMenuRoot");
6844
+ var DropdownMenuTrigger = /* @__PURE__ */ __name(({ children, className, testID }) => {
6845
+ const menu = useMenuContext("DropdownMenu.Trigger");
6846
+ const popover = usePopoverContext("DropdownMenu.Trigger");
6847
+ const onPress = React.useCallback(() => {
6848
+ popover.measureTrigger();
6849
+ popover.setOpen(!popover.open);
6850
+ }, [popover]);
6851
+ if (React.isValidElement(children)) {
6852
+ const child = children;
6853
+ const fire = /* @__PURE__ */ __name((existing) => (event) => {
6854
+ existing?.(event);
6855
+ popover.measureTrigger();
6856
+ popover.setOpen(!popover.open);
6857
+ }, "fire");
6858
+ return /* @__PURE__ */ jsxRuntime.jsx(
6859
+ Slot,
6860
+ {
6861
+ ref: (node) => {
6862
+ popover.triggerRef.current = node;
6863
+ },
6864
+ onClick: fire(child.props.onClick),
6865
+ onPress: fire(child.props.onPress),
6866
+ ...{
6867
+ "aria-haspopup": "menu",
6868
+ "aria-expanded": menu.open,
6869
+ "aria-controls": popover.contentId
6870
+ },
6871
+ ...testID !== void 0 ? { "data-testid": testID } : {},
6872
+ ...className !== void 0 ? { className } : {},
6873
+ children: child
6874
+ }
6875
+ );
6876
+ }
6877
+ return /* @__PURE__ */ jsxRuntime.jsx(
6878
+ reactNative.Pressable,
6879
+ {
6880
+ ref: (node) => {
6881
+ popover.triggerRef.current = node;
6882
+ },
6883
+ onPress,
6884
+ ...{
6885
+ "aria-haspopup": "menu",
6886
+ "aria-expanded": menu.open,
6887
+ "aria-controls": popover.contentId
6888
+ },
6889
+ ...testID !== void 0 ? { testID } : {},
6890
+ ...className !== void 0 ? { className } : {},
6891
+ children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children }) : children
6892
+ }
6893
+ );
6894
+ }, "DropdownMenuTrigger");
6895
+ var DropdownMenuContent = /* @__PURE__ */ __name((props) => /* @__PURE__ */ jsxRuntime.jsx(MenuContent, { ...props }), "DropdownMenuContent");
6896
+ var DropdownMenu = Object.assign(DropdownMenuRoot, {
6897
+ Trigger: DropdownMenuTrigger,
6898
+ Content: DropdownMenuContent,
6899
+ Item: MenuItem,
6900
+ Separator: MenuSeparator,
6901
+ Label: MenuLabel
6902
+ });
6903
+ var ContextMenuCtx = React.createContext(null);
6904
+ var useContextMenuCtx = /* @__PURE__ */ __name(() => {
6905
+ const ctx = React.useContext(ContextMenuCtx);
6906
+ if (!ctx) {
6907
+ throw new Error("ContextMenu compound parts must be rendered inside a <ContextMenu>.");
6908
+ }
6909
+ return ctx;
6910
+ }, "useContextMenuCtx");
6911
+ var ContextMenuRoot = /* @__PURE__ */ __name(({ open, defaultOpen = false, onOpenChange, children }) => {
6912
+ const [inner, setInner] = React.useState(defaultOpen);
6913
+ const isControlled = open !== void 0;
6914
+ const current = isControlled ? open : inner;
6915
+ const setOpen = React.useCallback(
6916
+ (next) => {
6917
+ if (!isControlled) {
6918
+ setInner(next);
6919
+ }
6920
+ onOpenChange?.(next);
6921
+ },
6922
+ [isControlled, onOpenChange]
6923
+ );
6924
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuCtx.Provider, { value: { open: current, setOpen }, children: /* @__PURE__ */ jsxRuntime.jsx(Popover, { open: current, onOpenChange: setOpen, children }) });
6925
+ }, "ContextMenuRoot");
6926
+ var ContextMenuTrigger = /* @__PURE__ */ __name(({ children, className, testID }) => {
6927
+ const ctx = useContextMenuCtx();
6928
+ const popover = usePopoverContext("ContextMenu.Trigger");
6929
+ const openMenu = React.useCallback(() => {
6930
+ popover.measureTrigger();
6931
+ ctx.setOpen(true);
6932
+ }, [ctx, popover]);
6933
+ if (reactNative.Platform.OS === "web") {
6934
+ if (React.isValidElement(children)) {
6935
+ const child = children;
6936
+ const existing = child.props.onContextMenu;
6937
+ return /* @__PURE__ */ jsxRuntime.jsx(
6938
+ Slot,
6939
+ {
6940
+ ref: (node) => {
6941
+ popover.triggerRef.current = node;
6942
+ },
6943
+ onContextMenu: (e) => {
6944
+ e.preventDefault();
6945
+ existing?.(e);
6946
+ openMenu();
6947
+ },
6948
+ ...{
6949
+ "aria-haspopup": "menu",
6950
+ "aria-expanded": ctx.open,
6951
+ "aria-controls": popover.contentId
6952
+ },
6953
+ ...testID !== void 0 ? { "data-testid": testID } : {},
6954
+ ...className !== void 0 ? { className } : {},
6955
+ children: child
6956
+ }
6957
+ );
6958
+ }
6959
+ return /* @__PURE__ */ jsxRuntime.jsx(
6960
+ reactNative.Pressable,
6961
+ {
6962
+ ref: (node) => {
6963
+ popover.triggerRef.current = node;
6964
+ },
6965
+ ...{
6966
+ onContextMenu: /* @__PURE__ */ __name((e) => {
6967
+ e.preventDefault();
6968
+ openMenu();
6969
+ }, "onContextMenu"),
6970
+ "aria-haspopup": "menu",
6971
+ "aria-expanded": ctx.open,
6972
+ "aria-controls": popover.contentId
6973
+ },
6974
+ ...testID !== void 0 ? { testID } : {},
6975
+ ...className !== void 0 ? { className } : {},
6976
+ children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children }) : children
6977
+ }
6978
+ );
6979
+ }
6980
+ if (React.isValidElement(children)) {
6981
+ const child = children;
6982
+ const existing = child.props.onLongPress;
6983
+ return /* @__PURE__ */ jsxRuntime.jsx(
6984
+ Slot,
6985
+ {
6986
+ ref: (node) => {
6987
+ popover.triggerRef.current = node;
6988
+ },
6989
+ onLongPress: (e) => {
6990
+ existing?.(e);
6991
+ openMenu();
6992
+ },
6993
+ accessibilityRole: "button",
6994
+ ...testID !== void 0 ? { testID } : {},
6995
+ ...className !== void 0 ? { className } : {},
6996
+ children: child
6997
+ }
6998
+ );
6999
+ }
7000
+ return /* @__PURE__ */ jsxRuntime.jsx(
7001
+ reactNative.Pressable,
7002
+ {
7003
+ ref: (node) => {
7004
+ popover.triggerRef.current = node;
7005
+ },
7006
+ onLongPress: openMenu,
7007
+ ...testID !== void 0 ? { testID } : {},
7008
+ ...className !== void 0 ? { className } : {},
7009
+ children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children }) : children
7010
+ }
7011
+ );
7012
+ }, "ContextMenuTrigger");
7013
+ var ContextMenuContent = /* @__PURE__ */ __name((props) => {
7014
+ const ctx = useContextMenuCtx();
7015
+ const close = React.useCallback(() => ctx.setOpen(false), [ctx]);
7016
+ return /* @__PURE__ */ jsxRuntime.jsx(MenuContextProvider, { open: ctx.open, close, children: /* @__PURE__ */ jsxRuntime.jsx(MenuContent, { ...props }) });
7017
+ }, "ContextMenuContent");
7018
+ var ContextMenu = Object.assign(ContextMenuRoot, {
7019
+ Trigger: ContextMenuTrigger,
7020
+ Content: ContextMenuContent,
7021
+ Item: MenuItem,
7022
+ Separator: MenuSeparator,
7023
+ Label: MenuLabel
7024
+ });
7025
+ function formatDate(date$1, locale) {
7026
+ try {
7027
+ return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date$1.toDate(date.getLocalTimeZone()));
7028
+ } catch {
7029
+ return `${date$1.year}-${String(date$1.month).padStart(2, "0")}-${String(date$1.day).padStart(2, "0")}`;
7030
+ }
7031
+ }
7032
+ __name(formatDate, "formatDate");
7033
+ function CalendarIcon({ size = 16, color = "currentColor" }) {
7034
+ const colors = useThemeColors();
7035
+ if (reactNative.Platform.OS === "web") {
7036
+ return /* @__PURE__ */ jsxRuntime.jsx(
7037
+ "svg",
7038
+ {
7039
+ width: size,
7040
+ height: size,
7041
+ viewBox: "0 0 24 24",
7042
+ fill: "none",
7043
+ stroke: color,
7044
+ strokeWidth: "2",
7045
+ strokeLinecap: "round",
7046
+ strokeLinejoin: "round",
7047
+ "aria-hidden": "true",
7048
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" })
7049
+ }
7050
+ );
7051
+ }
7052
+ const resolvedColor = color === "currentColor" ? colors.semantic.text.muted : color;
7053
+ return /* @__PURE__ */ jsxRuntime.jsx(
7054
+ reactNative.Text,
7055
+ {
7056
+ accessibilityElementsHidden: true,
7057
+ importantForAccessibility: "no-hide-descendants",
7058
+ style: { fontSize: size, lineHeight: size, color: resolvedColor },
7059
+ children: "\u{1F4C5}"
7060
+ }
7061
+ );
7062
+ }
7063
+ __name(CalendarIcon, "CalendarIcon");
7064
+ function buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek) {
7065
+ const out = {};
7066
+ if (minValue !== void 0) {
7067
+ out.minValue = minValue;
7068
+ }
7069
+ if (maxValue !== void 0) {
7070
+ out.maxValue = maxValue;
7071
+ }
7072
+ if (isDateUnavailable !== void 0) {
7073
+ out.isDateUnavailable = isDateUnavailable;
7074
+ }
7075
+ if (firstDayOfWeek !== void 0) {
7076
+ out.firstDayOfWeek = firstDayOfWeek;
7077
+ }
7078
+ return out;
7079
+ }
7080
+ __name(buildCalendarOptional, "buildCalendarOptional");
7081
+ function buildTriggerAriaProps(ariaProps) {
7082
+ const out = {};
7083
+ if (ariaProps["aria-labelledby"] !== void 0) {
7084
+ out["aria-labelledby"] = ariaProps["aria-labelledby"];
7085
+ }
7086
+ if (ariaProps["aria-describedby"] !== void 0) {
7087
+ out["aria-describedby"] = ariaProps["aria-describedby"];
7088
+ }
7089
+ if (ariaProps["aria-invalid"] !== void 0) {
7090
+ out["aria-invalid"] = ariaProps["aria-invalid"];
7091
+ }
7092
+ if (ariaProps["aria-required"] !== void 0) {
7093
+ out["aria-required"] = ariaProps["aria-required"];
7094
+ }
7095
+ return out;
7096
+ }
7097
+ __name(buildTriggerAriaProps, "buildTriggerAriaProps");
7098
+ var DatePickerRoot = /* @__PURE__ */ __name(({
7099
+ value,
7100
+ defaultValue: defaultValue2,
7101
+ onChange,
7102
+ locale: localeProp,
7103
+ minValue,
7104
+ maxValue,
7105
+ isDateUnavailable,
7106
+ firstDayOfWeek,
7107
+ placeholder,
7108
+ disabled = false,
7109
+ id,
7110
+ name: _name,
7111
+ className,
7112
+ testID,
7113
+ ...ariaProps
7114
+ }) => {
7115
+ const providerLocale = useLocale();
7116
+ const locale = localeProp ?? providerLocale;
7117
+ const [open, setOpen] = React.useState(false);
7118
+ const isControlled = value !== void 0;
7119
+ const [inner, setInner] = React.useState(defaultValue2 ?? null);
7120
+ const current = isControlled ? value ?? null : inner;
7121
+ const handleChange = React.useCallback(
7122
+ (date) => {
7123
+ if (!isControlled) {
7124
+ setInner(date);
7125
+ }
7126
+ onChange?.(date);
7127
+ setOpen(false);
7128
+ },
7129
+ [isControlled, onChange]
7130
+ );
7131
+ const handleOpenChange = React.useCallback(
7132
+ (next) => {
7133
+ if (!disabled) {
7134
+ setOpen(next);
7135
+ }
7136
+ },
7137
+ [disabled]
7138
+ );
7139
+ const displayValue = current ? formatDate(current, locale) : null;
7140
+ const calendarOptional = buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek);
7141
+ const triggerAriaProps = buildTriggerAriaProps(ariaProps);
7142
+ const colors = useThemeColors();
7143
+ const hasError = ariaProps["aria-invalid"] === true || ariaProps["aria-invalid"] === "true";
7144
+ const pressableStyle = {
7145
+ flexDirection: "row",
7146
+ alignItems: "center",
7147
+ borderWidth: 1,
7148
+ borderRadius: px(colors.radius.md),
7149
+ paddingHorizontal: px(colors.spacing["3"]),
7150
+ paddingVertical: px(colors.spacing["2"]),
7151
+ backgroundColor: colors.semantic.background.elevated,
7152
+ borderColor: hasError ? colors.color.danger : colors.semantic.border.default,
7153
+ opacity: disabled ? 0.6 : 1
7154
+ };
7155
+ const textStyle = {
7156
+ flex: 1,
7157
+ fontFamily: colors.fontFamily.body,
7158
+ fontSize: px(colors.fontSize.md),
7159
+ color: displayValue ? colors.semantic.text.default : colors.semantic.text.muted
7160
+ };
7161
+ const triggerExtraProps = {
7162
+ role: "combobox",
7163
+ accessibilityRole: "button",
7164
+ "aria-haspopup": "dialog",
7165
+ "aria-expanded": open,
7166
+ ...triggerAriaProps
7167
+ };
7168
+ if (id !== void 0) {
7169
+ triggerExtraProps.id = id;
7170
+ triggerExtraProps.nativeID = id;
7171
+ }
7172
+ if (testID !== void 0) {
7173
+ triggerExtraProps.testID = testID;
7174
+ }
7175
+ if (hasError) {
7176
+ triggerExtraProps["aria-invalid"] = true;
7177
+ }
7178
+ if (ariaProps["aria-required"]) {
7179
+ triggerExtraProps["aria-required"] = true;
7180
+ }
7181
+ if (disabled) {
7182
+ triggerExtraProps["aria-disabled"] = true;
7183
+ }
7184
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
7185
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.Trigger, { asChild: false, className: cn(className), children: /* @__PURE__ */ jsxRuntime.jsxs(
7186
+ reactNative.Pressable,
7187
+ {
7188
+ onPress: disabled ? void 0 : () => setOpen(!open),
7189
+ disabled,
7190
+ className: cn(
7191
+ "flex-row items-center rounded-md border px-3 py-2",
7192
+ hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
7193
+ disabled ? "opacity-60" : void 0,
7194
+ className
7195
+ ),
7196
+ style: pressableStyle,
7197
+ ...triggerExtraProps,
7198
+ children: [
7199
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: textStyle, numberOfLines: 1, children: displayValue ?? placeholder ?? "" }),
7200
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: px(colors.spacing["2"]) }, children: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: 16, color: colors.semantic.text.muted }) })
7201
+ ]
7202
+ }
7203
+ ) }),
7204
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { "aria-label": "Date picker", side: "bottom", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(
7205
+ Calendar,
7206
+ {
7207
+ mode: "single",
7208
+ value: current,
7209
+ onChange: (date) => {
7210
+ handleChange(date);
7211
+ },
7212
+ locale,
7213
+ ...calendarOptional
7214
+ }
7215
+ ) })
7216
+ ] });
7217
+ }, "DatePickerRoot");
7218
+ var DatePickerRange = /* @__PURE__ */ __name(({
7219
+ value,
7220
+ defaultValue: defaultValue2,
7221
+ onChange,
7222
+ locale: localeProp,
7223
+ minValue,
7224
+ maxValue,
7225
+ isDateUnavailable,
7226
+ firstDayOfWeek,
7227
+ placeholder,
7228
+ disabled = false,
7229
+ id,
7230
+ name: _name,
7231
+ className,
7232
+ testID,
7233
+ ...ariaProps
7234
+ }) => {
7235
+ const providerLocale = useLocale();
7236
+ const locale = localeProp ?? providerLocale;
7237
+ const [open, setOpen] = React.useState(false);
7238
+ const isControlled = value !== void 0;
7239
+ const [inner, setInner] = React.useState(defaultValue2 ?? { start: null, end: null });
7240
+ const current = isControlled ? value ?? { start: null, end: null } : inner;
7241
+ const calendarValue = current.start !== null ? { start: current.start, end: current.end } : null;
7242
+ const handleChange = React.useCallback(
7243
+ (calRange) => {
7244
+ const next = {
7245
+ start: calRange?.start ?? null,
7246
+ end: calRange?.end ?? null
7247
+ };
7248
+ if (!isControlled) {
7249
+ setInner(next);
7250
+ }
7251
+ onChange?.(next);
7252
+ if (next.start !== null && next.end !== null) {
7253
+ setOpen(false);
7254
+ }
7255
+ },
7256
+ [isControlled, onChange]
7257
+ );
7258
+ const handleOpenChange = React.useCallback(
7259
+ (next) => {
7260
+ if (!disabled) {
7261
+ setOpen(next);
7262
+ }
7263
+ },
7264
+ [disabled]
7265
+ );
7266
+ let displayValue = null;
7267
+ if (current.start !== null) {
7268
+ const startStr = formatDate(current.start, locale);
7269
+ const endStr = current.end !== null ? formatDate(current.end, locale) : "";
7270
+ displayValue = `${startStr} \u2013 ${endStr}`;
7271
+ }
7272
+ const calendarOptional = buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek);
7273
+ const triggerAriaProps = buildTriggerAriaProps(ariaProps);
7274
+ const colors = useThemeColors();
7275
+ const hasError = ariaProps["aria-invalid"] === true || ariaProps["aria-invalid"] === "true";
7276
+ const pressableStyle = {
7277
+ flexDirection: "row",
7278
+ alignItems: "center",
7279
+ borderWidth: 1,
7280
+ borderRadius: px(colors.radius.md),
7281
+ paddingHorizontal: px(colors.spacing["3"]),
7282
+ paddingVertical: px(colors.spacing["2"]),
7283
+ backgroundColor: colors.semantic.background.elevated,
7284
+ borderColor: hasError ? colors.color.danger : colors.semantic.border.default,
7285
+ opacity: disabled ? 0.6 : 1
7286
+ };
7287
+ const textStyle = {
7288
+ flex: 1,
7289
+ fontFamily: colors.fontFamily.body,
7290
+ fontSize: px(colors.fontSize.md),
7291
+ color: displayValue ? colors.semantic.text.default : colors.semantic.text.muted
7292
+ };
7293
+ const triggerExtraProps = {
7294
+ role: "combobox",
7295
+ accessibilityRole: "button",
7296
+ "aria-haspopup": "dialog",
7297
+ "aria-expanded": open,
7298
+ ...triggerAriaProps
7299
+ };
7300
+ if (id !== void 0) {
7301
+ triggerExtraProps.id = id;
7302
+ triggerExtraProps.nativeID = id;
7303
+ }
7304
+ if (testID !== void 0) {
7305
+ triggerExtraProps.testID = testID;
7306
+ }
7307
+ if (hasError) {
7308
+ triggerExtraProps["aria-invalid"] = true;
7309
+ }
7310
+ if (ariaProps["aria-required"]) {
7311
+ triggerExtraProps["aria-required"] = true;
7312
+ }
7313
+ if (disabled) {
7314
+ triggerExtraProps["aria-disabled"] = true;
7315
+ }
7316
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
7317
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.Trigger, { asChild: false, className: cn(className), children: /* @__PURE__ */ jsxRuntime.jsxs(
7318
+ reactNative.Pressable,
7319
+ {
7320
+ onPress: disabled ? void 0 : () => setOpen(!open),
7321
+ disabled,
7322
+ className: cn(
7323
+ "flex-row items-center rounded-md border px-3 py-2",
7324
+ hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
7325
+ disabled ? "opacity-60" : void 0,
7326
+ className
7327
+ ),
7328
+ style: pressableStyle,
7329
+ ...triggerExtraProps,
7330
+ children: [
7331
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: textStyle, numberOfLines: 1, children: displayValue ?? placeholder ?? "" }),
7332
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: px(colors.spacing["2"]) }, children: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: 16, color: colors.semantic.text.muted }) })
7333
+ ]
7334
+ }
7335
+ ) }),
7336
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { "aria-label": "Date range picker", side: "bottom", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(
7337
+ Calendar,
7338
+ {
7339
+ mode: "range",
7340
+ value: calendarValue,
7341
+ onChange: (range2) => {
7342
+ handleChange(range2);
7343
+ },
7344
+ locale,
7345
+ ...calendarOptional
7346
+ }
7347
+ ) })
7348
+ ] });
7349
+ }, "DatePickerRange");
7350
+ var DatePicker = Object.assign(DatePickerRoot, {
7351
+ Range: DatePickerRange
7352
+ });
6614
7353
  var DialogContext = React.createContext(null);
6615
7354
  var useDialogContext = /* @__PURE__ */ __name((label) => {
6616
7355
  const ctx = React.useContext(DialogContext);
@@ -12291,7 +13030,10 @@ exports.Button = Button;
12291
13030
  exports.Calendar = Calendar;
12292
13031
  exports.Card = Card;
12293
13032
  exports.Checkbox = Checkbox;
13033
+ exports.ContextMenu = ContextMenu;
13034
+ exports.DatePicker = DatePicker;
12294
13035
  exports.Dialog = Dialog;
13036
+ exports.DropdownMenu = DropdownMenu;
12295
13037
  exports.Field = Field;
12296
13038
  exports.FloatButton = FloatButton;
12297
13039
  exports.HStack = HStack;
@@ -12300,6 +13042,10 @@ exports.Icon = Icon;
12300
13042
  exports.InputGroup = InputGroup;
12301
13043
  exports.Label = Label;
12302
13044
  exports.LocaleProvider = LocaleProvider;
13045
+ exports.MenuContent = MenuContent;
13046
+ exports.MenuItem = MenuItem;
13047
+ exports.MenuLabel = MenuLabel;
13048
+ exports.MenuSeparator = MenuSeparator;
12303
13049
  exports.NoriProvider = NoriProvider;
12304
13050
  exports.PAGINATION_COMPACT_BREAKPOINT = PAGINATION_COMPACT_BREAKPOINT;
12305
13051
  exports.Pagination = Pagination;
@@ -12346,6 +13092,7 @@ exports.useCalendarCaption = useCalendarCaption;
12346
13092
  exports.useColorScheme = useColorScheme;
12347
13093
  exports.useLocale = useLocale;
12348
13094
  exports.usePagination = usePagination;
13095
+ exports.usePopoverContext = usePopoverContext;
12349
13096
  exports.useSemanticIcon = useSemanticIcon;
12350
13097
  exports.useSliderInteractionActive = useSliderInteractionActive;
12351
13098
  exports.useTheme = useTheme;