@nori-ui/core 1.2.0 → 1.4.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 (56) 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-BNDUQNG7.js +443 -0
  6. package/dist/chunk-BNDUQNG7.js.map +1 -0
  7. package/dist/chunk-H7MFAFV4.js +303 -0
  8. package/dist/chunk-H7MFAFV4.js.map +1 -0
  9. package/dist/chunk-KCLWPSV5.js +134 -0
  10. package/dist/chunk-KCLWPSV5.js.map +1 -0
  11. package/dist/{chunk-7D2BHQ6M.js → chunk-L5X4SYJ4.js} +3 -3
  12. package/dist/chunk-L5X4SYJ4.js.map +1 -0
  13. package/dist/{chunk-XBNVKPJN.js → chunk-XXBN6CIK.js} +3 -3
  14. package/dist/{chunk-XBNVKPJN.js.map → chunk-XXBN6CIK.js.map} +1 -1
  15. package/dist/chunk-ZPUYNM37.js +3 -0
  16. package/dist/chunk-ZPUYNM37.js.map +1 -0
  17. package/dist/client.cjs +879 -21
  18. package/dist/client.cjs.map +1 -1
  19. package/dist/client.d.cts +4 -1
  20. package/dist/client.d.ts +4 -1
  21. package/dist/client.js +18 -13
  22. package/dist/client.js.map +1 -1
  23. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  24. package/dist/components/Breadcrumb/index.js +3 -2
  25. package/dist/components/ContextMenu/index.cjs +1150 -0
  26. package/dist/components/ContextMenu/index.cjs.map +1 -0
  27. package/dist/components/ContextMenu/index.d.cts +38 -0
  28. package/dist/components/ContextMenu/index.d.ts +38 -0
  29. package/dist/components/ContextMenu/index.js +10 -0
  30. package/dist/components/ContextMenu/index.js.map +1 -0
  31. package/dist/components/DatePicker/index.cjs.map +1 -1
  32. package/dist/components/DatePicker/index.js +3 -2
  33. package/dist/components/DropdownMenu/index.cjs +1032 -0
  34. package/dist/components/DropdownMenu/index.cjs.map +1 -0
  35. package/dist/components/DropdownMenu/index.d.cts +97 -0
  36. package/dist/components/DropdownMenu/index.d.ts +97 -0
  37. package/dist/components/DropdownMenu/index.js +10 -0
  38. package/dist/components/DropdownMenu/index.js.map +1 -0
  39. package/dist/components/Popover/index.cjs +1 -0
  40. package/dist/components/Popover/index.cjs.map +1 -1
  41. package/dist/components/Popover/index.d.cts +22 -1
  42. package/dist/components/Popover/index.d.ts +22 -1
  43. package/dist/components/Popover/index.js +2 -1
  44. package/dist/components/Sheet/index.cjs +855 -0
  45. package/dist/components/Sheet/index.cjs.map +1 -0
  46. package/dist/components/Sheet/index.d.cts +104 -0
  47. package/dist/components/Sheet/index.d.ts +104 -0
  48. package/dist/components/Sheet/index.js +8 -0
  49. package/dist/components/Sheet/index.js.map +1 -0
  50. package/dist/index.cjs +879 -21
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +4 -1
  53. package/dist/index.d.ts +4 -1
  54. package/dist/index.js +18 -13
  55. package/package.json +1 -1
  56. package/dist/chunk-7D2BHQ6M.js.map +0 -1
package/dist/client.cjs CHANGED
@@ -6611,6 +6611,417 @@ 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
+ });
6614
7025
  function formatDate(date$1, locale) {
6615
7026
  try {
6616
7027
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date$1.toDate(date.getLocalTimeZone()));
@@ -10254,25 +10665,455 @@ var Separator = /* @__PURE__ */ __name(({
10254
10665
  }
10255
10666
  );
10256
10667
  }, "Separator");
10257
- var PULSE_DURATION_MS = 900;
10258
- var PULSE_MIN = 0.55;
10259
- var PULSE_MAX = 1;
10260
- var Skeleton = /* @__PURE__ */ __name(({
10261
- width = "100%",
10262
- height = 16,
10263
- radius = 6,
10264
- static: isStatic = false,
10265
- className,
10266
- style,
10267
- testID
10668
+ var SIZE_PERCENT = {
10669
+ sm: "25%",
10670
+ md: "50%",
10671
+ lg: "75%",
10672
+ full: "100%"
10673
+ };
10674
+ var SheetContext = React.createContext(null);
10675
+ var useSheetContext = /* @__PURE__ */ __name((label) => {
10676
+ const ctx = React.useContext(SheetContext);
10677
+ if (!ctx) {
10678
+ throw new Error(`<${label}> must be rendered inside a <Sheet>.`);
10679
+ }
10680
+ return ctx;
10681
+ }, "useSheetContext");
10682
+ var SheetRoot = /* @__PURE__ */ __name(({
10683
+ open,
10684
+ defaultOpen = false,
10685
+ onOpenChange,
10686
+ side = "bottom",
10687
+ size = "md",
10688
+ dismissible = true,
10689
+ children
10268
10690
  }) => {
10269
- const colors = useThemeColors();
10270
- const isDark = useColorScheme() === "dark";
10271
- const opacity = React.useRef(new reactNative.Animated.Value(PULSE_MAX)).current;
10272
- React.useEffect(() => {
10273
- if (isStatic) {
10274
- return;
10275
- }
10691
+ const [inner, setInner] = React.useState(defaultOpen);
10692
+ const isControlled = open !== void 0;
10693
+ const current = isControlled ? open : inner;
10694
+ const setOpen = React.useCallback(
10695
+ (next) => {
10696
+ if (!isControlled) {
10697
+ setInner(next);
10698
+ }
10699
+ onOpenChange?.(next);
10700
+ },
10701
+ [isControlled, onOpenChange]
10702
+ );
10703
+ const baseId = React.useId();
10704
+ const triggerRef = React.useRef(null);
10705
+ const ctxValue = {
10706
+ open: current,
10707
+ setOpen,
10708
+ titleId: `${baseId}-title`,
10709
+ descriptionId: `${baseId}-description`,
10710
+ triggerRef,
10711
+ side,
10712
+ size,
10713
+ dismissible
10714
+ };
10715
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetContext.Provider, { value: ctxValue, children });
10716
+ }, "SheetRoot");
10717
+ var SheetTrigger = /* @__PURE__ */ __name(({ asChild = true, children, className, testID }) => {
10718
+ const ctx = useSheetContext("SheetTrigger");
10719
+ const onPress = React.useCallback(() => ctx.setOpen(true), [ctx]);
10720
+ if (asChild && React.isValidElement(children)) {
10721
+ const child = children;
10722
+ const fire = /* @__PURE__ */ __name((existing) => (event) => {
10723
+ existing?.(event);
10724
+ ctx.setOpen(true);
10725
+ }, "fire");
10726
+ return /* @__PURE__ */ jsxRuntime.jsx(
10727
+ Slot,
10728
+ {
10729
+ ref: (node) => {
10730
+ ctx.triggerRef.current = node;
10731
+ },
10732
+ onClick: fire(child.props.onClick),
10733
+ onPress: fire(child.props.onPress),
10734
+ ...testID !== void 0 ? { "data-testid": testID } : {},
10735
+ ...className !== void 0 ? { className } : {},
10736
+ children: child
10737
+ }
10738
+ );
10739
+ }
10740
+ return /* @__PURE__ */ jsxRuntime.jsx(
10741
+ reactNative.Pressable,
10742
+ {
10743
+ ref: (node) => {
10744
+ ctx.triggerRef.current = node;
10745
+ },
10746
+ onPress,
10747
+ ...testID !== void 0 ? { testID } : {},
10748
+ ...className !== void 0 ? { className } : {},
10749
+ children: wrapStringChildren5(children)
10750
+ }
10751
+ );
10752
+ }, "SheetTrigger");
10753
+ var SheetHeader = /* @__PURE__ */ __name(({ children, className }) => {
10754
+ const colors = useThemeColors();
10755
+ return /* @__PURE__ */ jsxRuntime.jsx(
10756
+ reactNative.View,
10757
+ {
10758
+ className: cn("flex-col gap-1", className),
10759
+ style: {
10760
+ flexDirection: "column",
10761
+ gap: px(colors.spacing["1"]),
10762
+ paddingHorizontal: px(colors.spacing["6"]),
10763
+ paddingTop: px(colors.spacing["6"]),
10764
+ paddingBottom: px(colors.spacing["2"])
10765
+ },
10766
+ children
10767
+ }
10768
+ );
10769
+ }, "SheetHeader");
10770
+ var SheetTitle = /* @__PURE__ */ __name(({ children, className }) => {
10771
+ const ctx = useSheetContext("SheetTitle");
10772
+ const colors = useThemeColors();
10773
+ return /* @__PURE__ */ jsxRuntime.jsx(
10774
+ reactNative.Text,
10775
+ {
10776
+ nativeID: ctx.titleId,
10777
+ id: ctx.titleId,
10778
+ role: "heading",
10779
+ "aria-level": 2,
10780
+ className: cn("text-lg font-semibold text-semantic-text-default", className),
10781
+ style: {
10782
+ color: colors.semantic.text.default,
10783
+ fontFamily: colors.fontFamily.display,
10784
+ fontSize: px(colors.fontSize.lg),
10785
+ fontWeight: colors.fontWeight.semibold
10786
+ },
10787
+ children
10788
+ }
10789
+ );
10790
+ }, "SheetTitle");
10791
+ var SheetDescription = /* @__PURE__ */ __name(({ children, className }) => {
10792
+ const ctx = useSheetContext("SheetDescription");
10793
+ const colors = useThemeColors();
10794
+ return /* @__PURE__ */ jsxRuntime.jsx(
10795
+ reactNative.Text,
10796
+ {
10797
+ nativeID: ctx.descriptionId,
10798
+ id: ctx.descriptionId,
10799
+ className: cn("text-sm text-semantic-text-muted", className),
10800
+ style: {
10801
+ color: colors.semantic.text.muted,
10802
+ fontFamily: colors.fontFamily.body,
10803
+ fontSize: px(colors.fontSize.sm),
10804
+ lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal)
10805
+ },
10806
+ children
10807
+ }
10808
+ );
10809
+ }, "SheetDescription");
10810
+ var SheetBody = /* @__PURE__ */ __name(({ children, className }) => {
10811
+ const colors = useThemeColors();
10812
+ return /* @__PURE__ */ jsxRuntime.jsx(
10813
+ reactNative.View,
10814
+ {
10815
+ className: cn("flex-1", className),
10816
+ style: {
10817
+ flex: 1,
10818
+ paddingHorizontal: px(colors.spacing["6"]),
10819
+ paddingVertical: px(colors.spacing["4"])
10820
+ },
10821
+ children
10822
+ }
10823
+ );
10824
+ }, "SheetBody");
10825
+ var SheetFooter = /* @__PURE__ */ __name(({ children, className }) => {
10826
+ const colors = useThemeColors();
10827
+ return /* @__PURE__ */ jsxRuntime.jsx(
10828
+ reactNative.View,
10829
+ {
10830
+ className: cn("flex-row items-center justify-end gap-2", className),
10831
+ style: {
10832
+ flexDirection: "row",
10833
+ alignItems: "center",
10834
+ justifyContent: "flex-end",
10835
+ gap: px(colors.spacing["2"]),
10836
+ paddingHorizontal: px(colors.spacing["6"]),
10837
+ paddingBottom: px(colors.spacing["6"]),
10838
+ paddingTop: px(colors.spacing["2"])
10839
+ },
10840
+ children
10841
+ }
10842
+ );
10843
+ }, "SheetFooter");
10844
+ var SheetClose = /* @__PURE__ */ __name(({
10845
+ asChild = true,
10846
+ children,
10847
+ className,
10848
+ testID,
10849
+ accessibilityLabel = "Close"
10850
+ }) => {
10851
+ const ctx = useSheetContext("SheetClose");
10852
+ const onPress = React.useCallback(() => ctx.setOpen(false), [ctx]);
10853
+ if (asChild && React.isValidElement(children)) {
10854
+ const child = children;
10855
+ const fire = /* @__PURE__ */ __name((existing) => (event) => {
10856
+ existing?.(event);
10857
+ ctx.setOpen(false);
10858
+ }, "fire");
10859
+ return /* @__PURE__ */ jsxRuntime.jsx(
10860
+ Slot,
10861
+ {
10862
+ onClick: fire(child.props.onClick),
10863
+ onPress: fire(child.props.onPress),
10864
+ ...testID !== void 0 ? { "data-testid": testID } : {},
10865
+ ...className !== void 0 ? { className } : {},
10866
+ children: child
10867
+ }
10868
+ );
10869
+ }
10870
+ return /* @__PURE__ */ jsxRuntime.jsx(
10871
+ reactNative.Pressable,
10872
+ {
10873
+ onPress,
10874
+ role: "button",
10875
+ accessibilityRole: "button",
10876
+ accessibilityLabel,
10877
+ "aria-label": accessibilityLabel,
10878
+ ...testID !== void 0 ? { testID } : {},
10879
+ ...className !== void 0 ? { className } : {},
10880
+ children: wrapStringChildren5(children)
10881
+ }
10882
+ );
10883
+ }, "SheetClose");
10884
+ function wrapStringChildren5(children) {
10885
+ if (typeof children === "string" || typeof children === "number") {
10886
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children });
10887
+ }
10888
+ return children;
10889
+ }
10890
+ __name(wrapStringChildren5, "wrapStringChildren");
10891
+ var SCRIM_COLOR3 = "rgba(0, 0, 0, 0.40)";
10892
+ var FOCUSABLE_SELECTOR3 = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
10893
+ var SheetPanel = /* @__PURE__ */ __name(({ children, className, testID }) => {
10894
+ const ctx = useSheetContext("SheetPanel");
10895
+ const colors = useThemeColors();
10896
+ const panelRef = React.useRef(null);
10897
+ const overlayDomRef = React.useRef(null);
10898
+ const [entered, setEntered] = React.useState(false);
10899
+ React.useEffect(() => {
10900
+ if (reactNative.Platform.OS !== "web") {
10901
+ setEntered(true);
10902
+ return;
10903
+ }
10904
+ if (!ctx.open) {
10905
+ setEntered(false);
10906
+ return;
10907
+ }
10908
+ const id = requestAnimationFrame(() => setEntered(true));
10909
+ return () => cancelAnimationFrame(id);
10910
+ }, [ctx.open]);
10911
+ React.useEffect(() => {
10912
+ if (reactNative.Platform.OS !== "web") {
10913
+ return;
10914
+ }
10915
+ const node = overlayDomRef.current;
10916
+ if (!node) {
10917
+ return;
10918
+ }
10919
+ node.style.transitionProperty = "background-color";
10920
+ node.style.transitionDuration = "200ms";
10921
+ node.style.transitionTimingFunction = "ease-out";
10922
+ node.style.backgroundColor = entered ? SCRIM_COLOR3 : "rgba(0,0,0,0)";
10923
+ }, [entered]);
10924
+ React.useEffect(() => {
10925
+ if (!ctx.open || reactNative.Platform.OS !== "web" || typeof document === "undefined") {
10926
+ return;
10927
+ }
10928
+ const previouslyFocused = document.activeElement;
10929
+ const prevBodyOverflow = document.body.style.overflow;
10930
+ document.body.style.overflow = "hidden";
10931
+ const focusFirst = /* @__PURE__ */ __name(() => {
10932
+ const node = panelRef.current;
10933
+ if (!node) {
10934
+ return;
10935
+ }
10936
+ const focusable = node.querySelectorAll(FOCUSABLE_SELECTOR3);
10937
+ const first = focusable[0];
10938
+ if (first) {
10939
+ first.focus();
10940
+ } else {
10941
+ node.setAttribute("tabindex", "-1");
10942
+ node.focus();
10943
+ }
10944
+ }, "focusFirst");
10945
+ focusFirst();
10946
+ const onKeyDown = /* @__PURE__ */ __name((event) => {
10947
+ if (event.key === "Escape") {
10948
+ event.preventDefault();
10949
+ ctx.setOpen(false);
10950
+ return;
10951
+ }
10952
+ if (event.key !== "Tab") {
10953
+ return;
10954
+ }
10955
+ const node = panelRef.current;
10956
+ if (!node) {
10957
+ return;
10958
+ }
10959
+ const focusable = Array.from(node.querySelectorAll(FOCUSABLE_SELECTOR3)).filter(
10960
+ (el) => el.offsetParent !== null || el === document.activeElement
10961
+ );
10962
+ if (focusable.length === 0) {
10963
+ event.preventDefault();
10964
+ return;
10965
+ }
10966
+ const first = focusable[0];
10967
+ const last = focusable[focusable.length - 1];
10968
+ if (!first || !last) {
10969
+ return;
10970
+ }
10971
+ if (event.shiftKey) {
10972
+ if (document.activeElement === first || !node.contains(document.activeElement)) {
10973
+ event.preventDefault();
10974
+ last.focus();
10975
+ }
10976
+ } else if (document.activeElement === last) {
10977
+ event.preventDefault();
10978
+ first.focus();
10979
+ }
10980
+ }, "onKeyDown");
10981
+ document.addEventListener("keydown", onKeyDown);
10982
+ return () => {
10983
+ document.removeEventListener("keydown", onKeyDown);
10984
+ document.body.style.overflow = prevBodyOverflow;
10985
+ const restoreTo = ctx.triggerRef.current ?? previouslyFocused;
10986
+ restoreTo?.focus?.();
10987
+ };
10988
+ }, [ctx.open, ctx.setOpen, ctx.triggerRef]);
10989
+ const onBackdropPress = React.useCallback(() => {
10990
+ if (ctx.dismissible) {
10991
+ ctx.setOpen(false);
10992
+ }
10993
+ }, [ctx]);
10994
+ const isHorizontal = ctx.side === "left" || ctx.side === "right";
10995
+ const dim = typeof ctx.size === "number" ? ctx.size : SIZE_PERCENT[ctx.size];
10996
+ const panelStyle = {
10997
+ position: "absolute",
10998
+ backgroundColor: colors.semantic.background.elevated,
10999
+ ...isHorizontal ? { top: 0, bottom: 0 } : { left: 0, right: 0 },
11000
+ ...ctx.side === "bottom" && { bottom: 0 },
11001
+ ...ctx.side === "top" && { top: 0 },
11002
+ ...ctx.side === "left" && { left: 0 },
11003
+ ...ctx.side === "right" && { right: 0 }
11004
+ };
11005
+ const translateStyle = reactNative.Platform.OS === "web" ? {
11006
+ transform: entered ? "translateX(0) translateY(0)" : translateOffscreen(ctx.side),
11007
+ transitionProperty: "transform",
11008
+ transitionDuration: "280ms",
11009
+ transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)"
11010
+ } : {};
11011
+ const overlayStyle = {
11012
+ position: reactNative.Platform.OS === "web" ? "fixed" : "absolute",
11013
+ top: 0,
11014
+ left: 0,
11015
+ right: 0,
11016
+ bottom: 0,
11017
+ ...reactNative.Platform.OS === "web" ? { zIndex: 50 } : { backgroundColor: SCRIM_COLOR3 }
11018
+ };
11019
+ const sizeStyle = isHorizontal ? { width: dim, height: "100%" } : { height: dim, width: "100%" };
11020
+ return /* @__PURE__ */ jsxRuntime.jsx(
11021
+ reactNative.Modal,
11022
+ {
11023
+ visible: ctx.open,
11024
+ transparent: true,
11025
+ animationType: reactNative.Platform.OS === "web" ? "none" : ctx.side === "bottom" || ctx.side === "top" ? "slide" : "fade",
11026
+ onRequestClose: () => ctx.setOpen(false),
11027
+ children: /* @__PURE__ */ jsxRuntime.jsx(
11028
+ reactNative.Pressable,
11029
+ {
11030
+ accessibilityRole: "none",
11031
+ "aria-hidden": true,
11032
+ ref: (node) => {
11033
+ overlayDomRef.current = node;
11034
+ },
11035
+ style: overlayStyle,
11036
+ onPress: onBackdropPress,
11037
+ children: /* @__PURE__ */ jsxRuntime.jsx(
11038
+ reactNative.Pressable,
11039
+ {
11040
+ onPress: (event) => event.stopPropagation?.(),
11041
+ ref: (node) => {
11042
+ panelRef.current = node;
11043
+ },
11044
+ role: "dialog",
11045
+ accessibilityRole: "none",
11046
+ "aria-modal": true,
11047
+ "aria-labelledby": ctx.titleId,
11048
+ "aria-describedby": ctx.descriptionId,
11049
+ "data-side": ctx.side,
11050
+ ...testID !== void 0 ? { testID } : {},
11051
+ className: cn("bg-semantic-background-elevated", className),
11052
+ style: [
11053
+ panelStyle,
11054
+ sizeStyle,
11055
+ translateStyle,
11056
+ {
11057
+ shadowColor: "#000",
11058
+ shadowOffset: { width: 0, height: -2 },
11059
+ shadowOpacity: 0.15,
11060
+ shadowRadius: 20,
11061
+ elevation: 24,
11062
+ ...ctx.side === "bottom" ? { borderTopLeftRadius: 16, borderTopRightRadius: 16 } : {},
11063
+ ...ctx.side === "top" ? { borderBottomLeftRadius: 16, borderBottomRightRadius: 16 } : {}
11064
+ }
11065
+ ],
11066
+ children
11067
+ }
11068
+ )
11069
+ }
11070
+ )
11071
+ }
11072
+ );
11073
+ }, "SheetPanel");
11074
+ var Sheet = Object.assign(SheetRoot, {
11075
+ Trigger: SheetTrigger,
11076
+ Panel: SheetPanel,
11077
+ Header: SheetHeader,
11078
+ Title: SheetTitle,
11079
+ Description: SheetDescription,
11080
+ Body: SheetBody,
11081
+ Footer: SheetFooter,
11082
+ Close: SheetClose
11083
+ });
11084
+ var Drawer = Sheet;
11085
+ function translateOffscreen(side) {
11086
+ switch (side) {
11087
+ case "bottom":
11088
+ return "translateY(100%)";
11089
+ case "top":
11090
+ return "translateY(-100%)";
11091
+ case "left":
11092
+ return "translateX(-100%)";
11093
+ case "right":
11094
+ return "translateX(100%)";
11095
+ }
11096
+ }
11097
+ __name(translateOffscreen, "translateOffscreen");
11098
+ var PULSE_DURATION_MS = 900;
11099
+ var PULSE_MIN = 0.55;
11100
+ var PULSE_MAX = 1;
11101
+ var Skeleton = /* @__PURE__ */ __name(({
11102
+ width = "100%",
11103
+ height = 16,
11104
+ radius = 6,
11105
+ static: isStatic = false,
11106
+ className,
11107
+ style,
11108
+ testID
11109
+ }) => {
11110
+ const colors = useThemeColors();
11111
+ const isDark = useColorScheme() === "dark";
11112
+ const opacity = React.useRef(new reactNative.Animated.Value(PULSE_MAX)).current;
11113
+ React.useEffect(() => {
11114
+ if (isStatic) {
11115
+ return;
11116
+ }
10276
11117
  const loop = reactNative.Animated.loop(
10277
11118
  reactNative.Animated.sequence([
10278
11119
  reactNative.Animated.timing(opacity, {
@@ -12167,17 +13008,17 @@ var TooltipTrigger = /* @__PURE__ */ __name(({ asChild = true, children, classNa
12167
13008
  },
12168
13009
  ...testID !== void 0 ? { testID } : {},
12169
13010
  ...className !== void 0 ? { className } : {},
12170
- children: wrapStringChildren5(children)
13011
+ children: wrapStringChildren6(children)
12171
13012
  }
12172
13013
  );
12173
13014
  }, "TooltipTrigger");
12174
- function wrapStringChildren5(children) {
13015
+ function wrapStringChildren6(children) {
12175
13016
  if (typeof children === "string" || typeof children === "number") {
12176
13017
  return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children });
12177
13018
  }
12178
13019
  return children;
12179
13020
  }
12180
- __name(wrapStringChildren5, "wrapStringChildren");
13021
+ __name(wrapStringChildren6, "wrapStringChildren");
12181
13022
  var GAP2 = 4;
12182
13023
  var MIN_WIDTH2 = 0;
12183
13024
  function computePosition2(rect, side, align, contentSize) {
@@ -12619,8 +13460,11 @@ exports.Button = Button;
12619
13460
  exports.Calendar = Calendar;
12620
13461
  exports.Card = Card;
12621
13462
  exports.Checkbox = Checkbox;
13463
+ exports.ContextMenu = ContextMenu;
12622
13464
  exports.DatePicker = DatePicker;
12623
13465
  exports.Dialog = Dialog;
13466
+ exports.Drawer = Drawer;
13467
+ exports.DropdownMenu = DropdownMenu;
12624
13468
  exports.Field = Field;
12625
13469
  exports.FloatButton = FloatButton;
12626
13470
  exports.HStack = HStack;
@@ -12629,6 +13473,10 @@ exports.Icon = Icon;
12629
13473
  exports.InputGroup = InputGroup;
12630
13474
  exports.Label = Label;
12631
13475
  exports.LocaleProvider = LocaleProvider;
13476
+ exports.MenuContent = MenuContent;
13477
+ exports.MenuItem = MenuItem;
13478
+ exports.MenuLabel = MenuLabel;
13479
+ exports.MenuSeparator = MenuSeparator;
12632
13480
  exports.NoriProvider = NoriProvider;
12633
13481
  exports.PAGINATION_COMPACT_BREAKPOINT = PAGINATION_COMPACT_BREAKPOINT;
12634
13482
  exports.Pagination = Pagination;
@@ -12639,6 +13487,15 @@ exports.SegmentedControl = SegmentedControl;
12639
13487
  exports.Select = Select;
12640
13488
  exports.SemanticIconsProvider = SemanticIconsProvider;
12641
13489
  exports.Separator = Separator;
13490
+ exports.Sheet = Sheet;
13491
+ exports.SheetBody = SheetBody;
13492
+ exports.SheetClose = SheetClose;
13493
+ exports.SheetDescription = SheetDescription;
13494
+ exports.SheetFooter = SheetFooter;
13495
+ exports.SheetHeader = SheetHeader;
13496
+ exports.SheetPanel = SheetPanel;
13497
+ exports.SheetTitle = SheetTitle;
13498
+ exports.SheetTrigger = SheetTrigger;
12642
13499
  exports.Skeleton = Skeleton;
12643
13500
  exports.Slider = Slider;
12644
13501
  exports.SliderGestureProvider = SliderGestureProvider;
@@ -12675,6 +13532,7 @@ exports.useCalendarCaption = useCalendarCaption;
12675
13532
  exports.useColorScheme = useColorScheme;
12676
13533
  exports.useLocale = useLocale;
12677
13534
  exports.usePagination = usePagination;
13535
+ exports.usePopoverContext = usePopoverContext;
12678
13536
  exports.useSemanticIcon = useSemanticIcon;
12679
13537
  exports.useSliderInteractionActive = useSliderInteractionActive;
12680
13538
  exports.useTheme = useTheme;