@wello-dev/core 1.0.4 → 1.0.6

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 (73) hide show
  1. package/dist/{chunk-FIAJMBSD.js → chunk-2TFJ4SMR.js} +3 -3
  2. package/dist/chunk-2TFJ4SMR.js.map +1 -0
  3. package/dist/{chunk-6U4Y3AUT.js → chunk-2WHZJI3S.js} +3 -3
  4. package/dist/{chunk-F2FJLMJF.js → chunk-652ZEQV7.js} +4 -4
  5. package/dist/{chunk-YQOS23WP.js → chunk-7EINGVGG.js} +2 -2
  6. package/dist/{chunk-YOL5PMHU.js → chunk-7S7RIVCI.js} +2 -2
  7. package/dist/{chunk-PPKKOBHB.js → chunk-A76QHCP5.js} +2 -2
  8. package/dist/{chunk-TJUOXXLK.js → chunk-BZPG4NZ6.js} +2 -2
  9. package/dist/chunk-DRSBB5T4.js +206 -0
  10. package/dist/chunk-DRSBB5T4.js.map +1 -0
  11. package/dist/{chunk-HGYIOR5F.js → chunk-ESMDK5GY.js} +2 -2
  12. package/dist/{chunk-GD5URO3H.js → chunk-FSR3OEUP.js} +4 -4
  13. package/dist/{chunk-52P4CIAK.js → chunk-HBBXBVK6.js} +2 -2
  14. package/dist/{chunk-63PSLIW5.js → chunk-K3B2RENY.js} +2 -2
  15. package/dist/{chunk-ZTOAB4HM.js → chunk-NGXT7GNE.js} +2 -2
  16. package/dist/{chunk-O4MQLZEH.js → chunk-NH26XE7T.js} +2 -2
  17. package/dist/{chunk-7GLDYLJ6.js → chunk-O6A7IBIW.js} +2 -2
  18. package/dist/{chunk-F4OMXH3E.js → chunk-QCMTAQSP.js} +17 -10
  19. package/dist/chunk-QCMTAQSP.js.map +1 -0
  20. package/dist/{chunk-2XGMU4QA.js → chunk-RVFCTNPD.js} +20 -4
  21. package/dist/chunk-RVFCTNPD.js.map +1 -0
  22. package/dist/{chunk-KEYIOWAG.js → chunk-TIVOXLDX.js} +3 -3
  23. package/dist/{chunk-KEYIOWAG.js.map → chunk-TIVOXLDX.js.map} +1 -1
  24. package/dist/{chunk-QZFPW75D.js → chunk-XBLREJCR.js} +30 -3
  25. package/dist/chunk-XBLREJCR.js.map +1 -0
  26. package/dist/{chunk-K2Q5Q6WQ.js → chunk-YRKCM3OL.js} +10 -6
  27. package/dist/chunk-YRKCM3OL.js.map +1 -0
  28. package/dist/components/ColorPicker/ColorInput.js +4 -4
  29. package/dist/components/Combobox/Combobox.js +4 -4
  30. package/dist/components/Combobox/Select.js +5 -5
  31. package/dist/components/Combobox/TagsInput.js +5 -5
  32. package/dist/components/Dialog/Dialog.js +2 -2
  33. package/dist/components/Dropzone/Dropzone.js +4 -4
  34. package/dist/components/Menu/Menu.js +4 -4
  35. package/dist/components/Modal/Drawer.js +3 -3
  36. package/dist/components/Modal/Modal.js +3 -3
  37. package/dist/components/Modal/ModalBase.js +2 -2
  38. package/dist/components/NumberFormatter/NumberFormatter.js +1 -1
  39. package/dist/components/PhoneInput/PhoneInput.js +6 -6
  40. package/dist/components/Popover/Popover.js +3 -3
  41. package/dist/components/Portal/Portal.js +1 -1
  42. package/dist/components/TextInput/TextInput.js +2 -2
  43. package/dist/components/Tooltip/Tooltip.js +3 -3
  44. package/dist/index.cjs +163 -95
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +7 -2
  47. package/dist/index.d.ts +7 -2
  48. package/dist/index.js +114 -114
  49. package/dist/shadcn/Command.js +6 -6
  50. package/dist/shadcn/Dialog.js +5 -5
  51. package/dist/shadcn/Floating.js +6 -6
  52. package/dist/styles.css +123 -15
  53. package/package.json +1 -1
  54. package/dist/chunk-2XGMU4QA.js.map +0 -1
  55. package/dist/chunk-F4OMXH3E.js.map +0 -1
  56. package/dist/chunk-FIAJMBSD.js.map +0 -1
  57. package/dist/chunk-K2Q5Q6WQ.js.map +0 -1
  58. package/dist/chunk-QZFPW75D.js.map +0 -1
  59. package/dist/chunk-YHPHWOAE.js +0 -192
  60. package/dist/chunk-YHPHWOAE.js.map +0 -1
  61. /package/dist/{chunk-6U4Y3AUT.js.map → chunk-2WHZJI3S.js.map} +0 -0
  62. /package/dist/{chunk-F2FJLMJF.js.map → chunk-652ZEQV7.js.map} +0 -0
  63. /package/dist/{chunk-YQOS23WP.js.map → chunk-7EINGVGG.js.map} +0 -0
  64. /package/dist/{chunk-YOL5PMHU.js.map → chunk-7S7RIVCI.js.map} +0 -0
  65. /package/dist/{chunk-PPKKOBHB.js.map → chunk-A76QHCP5.js.map} +0 -0
  66. /package/dist/{chunk-TJUOXXLK.js.map → chunk-BZPG4NZ6.js.map} +0 -0
  67. /package/dist/{chunk-HGYIOR5F.js.map → chunk-ESMDK5GY.js.map} +0 -0
  68. /package/dist/{chunk-GD5URO3H.js.map → chunk-FSR3OEUP.js.map} +0 -0
  69. /package/dist/{chunk-52P4CIAK.js.map → chunk-HBBXBVK6.js.map} +0 -0
  70. /package/dist/{chunk-63PSLIW5.js.map → chunk-K3B2RENY.js.map} +0 -0
  71. /package/dist/{chunk-ZTOAB4HM.js.map → chunk-NGXT7GNE.js.map} +0 -0
  72. /package/dist/{chunk-O4MQLZEH.js.map → chunk-NH26XE7T.js.map} +0 -0
  73. /package/dist/{chunk-7GLDYLJ6.js.map → chunk-O6A7IBIW.js.map} +0 -0
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  TagsInput
4
- } from "../../chunk-O4MQLZEH.js";
4
+ } from "../../chunk-NH26XE7T.js";
5
5
  import "../../chunk-CGR72YL6.js";
6
6
  import "../../chunk-UYKK6PVB.js";
7
- import "../../chunk-TJUOXXLK.js";
7
+ import "../../chunk-BZPG4NZ6.js";
8
8
  import "../../chunk-JJXJXOZ7.js";
9
9
  import "../../chunk-57ZKN6G3.js";
10
10
  import "../../chunk-YFBYWNYF.js";
11
11
  import "../../chunk-ZJZUNSCO.js";
12
- import "../../chunk-K2Q5Q6WQ.js";
13
- import "../../chunk-F4OMXH3E.js";
12
+ import "../../chunk-YRKCM3OL.js";
13
+ import "../../chunk-QCMTAQSP.js";
14
14
  import "../../chunk-AZ4WBNXD.js";
15
- import "../../chunk-FIAJMBSD.js";
15
+ import "../../chunk-2TFJ4SMR.js";
16
16
  import "../../chunk-H4D7LXZL.js";
17
17
  import "../../chunk-CTBTEAD6.js";
18
18
  import "../../chunk-5SQC5LKY.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Dialog
4
- } from "../../chunk-63PSLIW5.js";
4
+ } from "../../chunk-K3B2RENY.js";
5
5
  import "../../chunk-57ZKN6G3.js";
6
6
  import "../../chunk-YFBYWNYF.js";
7
7
  import "../../chunk-ZJZUNSCO.js";
8
- import "../../chunk-FIAJMBSD.js";
8
+ import "../../chunk-2TFJ4SMR.js";
9
9
  import "../../chunk-H4D7LXZL.js";
10
10
  import "../../chunk-CTBTEAD6.js";
11
11
  import "../../chunk-5SQC5LKY.js";
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Dropzone,
4
4
  formatFileSize
5
- } from "../../chunk-ZTOAB4HM.js";
6
- import "../../chunk-YQOS23WP.js";
7
- import "../../chunk-HGYIOR5F.js";
5
+ } from "../../chunk-NGXT7GNE.js";
6
+ import "../../chunk-7EINGVGG.js";
7
+ import "../../chunk-ESMDK5GY.js";
8
8
  import "../../chunk-NZQI4WL5.js";
9
9
  import "../../chunk-7KIXQ2XG.js";
10
10
  import "../../chunk-57ZKN6G3.js";
11
11
  import "../../chunk-YFBYWNYF.js";
12
12
  import "../../chunk-ZJZUNSCO.js";
13
13
  import "../../chunk-AZ4WBNXD.js";
14
- import "../../chunk-FIAJMBSD.js";
14
+ import "../../chunk-2TFJ4SMR.js";
15
15
  import "../../chunk-H4D7LXZL.js";
16
16
  import "../../chunk-CTBTEAD6.js";
17
17
  import "../../chunk-MYHAWRIV.js";
@@ -6,11 +6,11 @@ import {
6
6
  MenuItem,
7
7
  MenuLabel,
8
8
  MenuTarget
9
- } from "../../chunk-PPKKOBHB.js";
10
- import "../../chunk-K2Q5Q6WQ.js";
11
- import "../../chunk-F4OMXH3E.js";
9
+ } from "../../chunk-A76QHCP5.js";
10
+ import "../../chunk-YRKCM3OL.js";
11
+ import "../../chunk-QCMTAQSP.js";
12
12
  import "../../chunk-AZ4WBNXD.js";
13
- import "../../chunk-FIAJMBSD.js";
13
+ import "../../chunk-2TFJ4SMR.js";
14
14
  import "../../chunk-H4D7LXZL.js";
15
15
  import "../../chunk-CTBTEAD6.js";
16
16
  import "../../chunk-5SQC5LKY.js";
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  Drawer,
4
4
  DrawerRoot
5
- } from "../../chunk-7GLDYLJ6.js";
6
- import "../../chunk-HGYIOR5F.js";
5
+ } from "../../chunk-O6A7IBIW.js";
6
+ import "../../chunk-ESMDK5GY.js";
7
7
  import "../../chunk-NZQI4WL5.js";
8
8
  import "../../chunk-57ZKN6G3.js";
9
9
  import "../../chunk-YFBYWNYF.js";
10
10
  import "../../chunk-ZJZUNSCO.js";
11
11
  import "../../chunk-AZ4WBNXD.js";
12
- import "../../chunk-FIAJMBSD.js";
12
+ import "../../chunk-2TFJ4SMR.js";
13
13
  import "../../chunk-H4D7LXZL.js";
14
14
  import "../../chunk-CTBTEAD6.js";
15
15
  import "../../chunk-5SQC5LKY.js";
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  Modal,
4
4
  ModalRoot
5
- } from "../../chunk-YQOS23WP.js";
6
- import "../../chunk-HGYIOR5F.js";
5
+ } from "../../chunk-7EINGVGG.js";
6
+ import "../../chunk-ESMDK5GY.js";
7
7
  import "../../chunk-NZQI4WL5.js";
8
8
  import "../../chunk-57ZKN6G3.js";
9
9
  import "../../chunk-YFBYWNYF.js";
10
10
  import "../../chunk-ZJZUNSCO.js";
11
11
  import "../../chunk-AZ4WBNXD.js";
12
- import "../../chunk-FIAJMBSD.js";
12
+ import "../../chunk-2TFJ4SMR.js";
13
13
  import "../../chunk-H4D7LXZL.js";
14
14
  import "../../chunk-CTBTEAD6.js";
15
15
  import "../../chunk-5SQC5LKY.js";
@@ -9,13 +9,13 @@ import {
9
9
  ModalBaseTitle,
10
10
  sizeValue,
11
11
  useModalContext
12
- } from "../../chunk-HGYIOR5F.js";
12
+ } from "../../chunk-ESMDK5GY.js";
13
13
  import "../../chunk-NZQI4WL5.js";
14
14
  import "../../chunk-57ZKN6G3.js";
15
15
  import "../../chunk-YFBYWNYF.js";
16
16
  import "../../chunk-ZJZUNSCO.js";
17
17
  import "../../chunk-AZ4WBNXD.js";
18
- import "../../chunk-FIAJMBSD.js";
18
+ import "../../chunk-2TFJ4SMR.js";
19
19
  import {
20
20
  Transition
21
21
  } from "../../chunk-H4D7LXZL.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  NumberFormatter,
4
4
  formatNumber
5
- } from "../../chunk-KEYIOWAG.js";
5
+ } from "../../chunk-TIVOXLDX.js";
6
6
  import "../../chunk-4QBFXTYH.js";
7
7
  import "../../chunk-IK562BNJ.js";
8
8
  import "../../chunk-ORHFHJKL.js";
@@ -5,20 +5,20 @@ import {
5
5
  matchesPhoneStartingNumber,
6
6
  normalizeStartingNumber,
7
7
  resolvePhoneCountry
8
- } from "../../chunk-QZFPW75D.js";
8
+ } from "../../chunk-XBLREJCR.js";
9
9
  import "../../chunk-TVOR2RGE.js";
10
- import "../../chunk-2XGMU4QA.js";
10
+ import "../../chunk-RVFCTNPD.js";
11
11
  import "../../chunk-DHAMBKCR.js";
12
- import "../../chunk-TJUOXXLK.js";
12
+ import "../../chunk-BZPG4NZ6.js";
13
13
  import "../../chunk-JJXJXOZ7.js";
14
14
  import "../../chunk-DCC7EE67.js";
15
15
  import "../../chunk-57ZKN6G3.js";
16
16
  import "../../chunk-YFBYWNYF.js";
17
17
  import "../../chunk-ZJZUNSCO.js";
18
- import "../../chunk-K2Q5Q6WQ.js";
19
- import "../../chunk-F4OMXH3E.js";
18
+ import "../../chunk-YRKCM3OL.js";
19
+ import "../../chunk-QCMTAQSP.js";
20
20
  import "../../chunk-AZ4WBNXD.js";
21
- import "../../chunk-FIAJMBSD.js";
21
+ import "../../chunk-2TFJ4SMR.js";
22
22
  import "../../chunk-H4D7LXZL.js";
23
23
  import "../../chunk-CTBTEAD6.js";
24
24
  import "../../chunk-5SQC5LKY.js";
@@ -4,10 +4,10 @@ import {
4
4
  PopoverDropdown,
5
5
  PopoverTarget,
6
6
  usePopoverContext
7
- } from "../../chunk-K2Q5Q6WQ.js";
8
- import "../../chunk-F4OMXH3E.js";
7
+ } from "../../chunk-YRKCM3OL.js";
8
+ import "../../chunk-QCMTAQSP.js";
9
9
  import "../../chunk-AZ4WBNXD.js";
10
- import "../../chunk-FIAJMBSD.js";
10
+ import "../../chunk-2TFJ4SMR.js";
11
11
  import "../../chunk-H4D7LXZL.js";
12
12
  import "../../chunk-CTBTEAD6.js";
13
13
  import "../../chunk-CJ7I6UM7.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  OptionalPortal,
4
4
  Portal
5
- } from "../../chunk-FIAJMBSD.js";
5
+ } from "../../chunk-2TFJ4SMR.js";
6
6
  import "../../chunk-4QBFXTYH.js";
7
7
  import "../../chunk-IK562BNJ.js";
8
8
  import "../../chunk-ORHFHJKL.js";
@@ -5,8 +5,8 @@ import {
5
5
  PasswordInput,
6
6
  TextInput,
7
7
  Textarea
8
- } from "../../chunk-YOL5PMHU.js";
9
- import "../../chunk-KEYIOWAG.js";
8
+ } from "../../chunk-7S7RIVCI.js";
9
+ import "../../chunk-TIVOXLDX.js";
10
10
  import "../../chunk-JJXJXOZ7.js";
11
11
  import "../../chunk-57ZKN6G3.js";
12
12
  import "../../chunk-YFBYWNYF.js";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  Tooltip,
4
4
  TooltipFloating
5
- } from "../../chunk-6U4Y3AUT.js";
6
- import "../../chunk-F4OMXH3E.js";
7
- import "../../chunk-FIAJMBSD.js";
5
+ } from "../../chunk-2WHZJI3S.js";
6
+ import "../../chunk-QCMTAQSP.js";
7
+ import "../../chunk-2TFJ4SMR.js";
8
8
  import "../../chunk-H4D7LXZL.js";
9
9
  import "../../chunk-CTBTEAD6.js";
10
10
  import "../../chunk-TWM6DSH4.js";
package/dist/index.cjs CHANGED
@@ -3403,7 +3403,7 @@ function Portal(_props) {
3403
3403
  const { target, reuseTargetNode, className, id, children } = useProps("Portal", { reuseTargetNode: true }, _props);
3404
3404
  const [node, setNode] = (0, import_react16.useState)(null);
3405
3405
  const created = (0, import_react16.useRef)(null);
3406
- (0, import_react16.useEffect)(() => {
3406
+ (0, import_react16.useLayoutEffect)(() => {
3407
3407
  if (target) {
3408
3408
  const el = typeof target === "string" ? document.querySelector(target) : target;
3409
3409
  if (el) syncPortalDir(el);
@@ -5584,7 +5584,7 @@ function formatNumber(value, options = {}) {
5584
5584
  }
5585
5585
  function NumberFormatter(_props) {
5586
5586
  const { value, ...options } = useProps("NumberFormatter", {}, _props);
5587
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: formatNumber(value, options) });
5587
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { dir: "ltr", style: { unicodeBidi: "isolate" }, children: formatNumber(value, options) });
5588
5588
  }
5589
5589
 
5590
5590
  // src/components/Popover/Popover.tsx
@@ -5597,6 +5597,15 @@ function split(position) {
5597
5597
  const [side, align] = position.split("-");
5598
5598
  return [side, align ?? "center"];
5599
5599
  }
5600
+ function toPlaceAlign(align, dir, side) {
5601
+ if (align === "center") return "center";
5602
+ if (align === "left") return "start";
5603
+ if (align === "right") return "end";
5604
+ if (dir === "rtl" && (side === "top" || side === "bottom")) {
5605
+ return align === "start" ? "end" : "start";
5606
+ }
5607
+ return align;
5608
+ }
5600
5609
  function place(ref, width, height, side, align, offset) {
5601
5610
  let x = 0;
5602
5611
  let y = 0;
@@ -5640,10 +5649,8 @@ function useFloating(options) {
5640
5649
  const height = el.offsetHeight;
5641
5650
  const vw = document.documentElement.clientWidth;
5642
5651
  const vh = document.documentElement.clientHeight;
5643
- let [side, align] = split(position);
5644
- if (dir === "rtl" && (side === "top" || side === "bottom") && align !== "center") {
5645
- align = align === "start" ? "end" : "start";
5646
- }
5652
+ let [side, rawAlign] = split(position);
5653
+ const align = toPlaceAlign(rawAlign, dir, side);
5647
5654
  const locked = preventPositionChangeWhenVisible ? lockedSide.current : null;
5648
5655
  if (locked) side = locked;
5649
5656
  let { x, y } = place(rect, width, height, side, align, offset);
@@ -5683,7 +5690,7 @@ function useFloating(options) {
5683
5690
  arrowY = Math.min(Math.max(target, min), height - min);
5684
5691
  }
5685
5692
  }
5686
- const placement = align === "center" ? side : `${side}-${align}`;
5693
+ const placement = rawAlign === "center" ? side : `${side}-${rawAlign}`;
5687
5694
  if (placement !== lastPlacement.current) {
5688
5695
  lastPlacement.current = placement;
5689
5696
  changed.current?.(placement);
@@ -5718,17 +5725,17 @@ function useFloating(options) {
5718
5725
  }, [opened, update2]);
5719
5726
  const setReference = (0, import_react32.useCallback)(
5720
5727
  (node) => {
5721
- if (!node || node === reference.current) return;
5728
+ if (node === reference.current) return;
5722
5729
  reference.current = node;
5723
- if (opened) update2();
5730
+ if (node && opened) update2();
5724
5731
  },
5725
5732
  [opened, update2]
5726
5733
  );
5727
5734
  const setFloating = (0, import_react32.useCallback)(
5728
5735
  (node) => {
5729
- if (!node || node === floating.current) return;
5736
+ if (node === floating.current) return;
5730
5737
  floating.current = node;
5731
- update2();
5738
+ if (node) update2();
5732
5739
  },
5733
5740
  [update2]
5734
5741
  );
@@ -5784,14 +5791,14 @@ function Popover(_props) {
5784
5791
  props.onChange?.(next);
5785
5792
  (next ? props.onOpen : props.onClose)?.();
5786
5793
  };
5787
- const { dir } = useDirection();
5794
+ const { dir: appDir } = useDirection();
5788
5795
  const floating = useFloating({
5789
5796
  opened,
5790
5797
  position: props.position,
5791
5798
  offset: props.offset + (props.withArrow ? props.arrowSize / 2 : 0),
5792
5799
  flip: props.middlewares?.flip ?? true,
5793
5800
  shift: props.middlewares?.shift ?? true,
5794
- dir,
5801
+ dir: props.dir ?? appDir,
5795
5802
  arrowSize: props.withArrow ? props.arrowSize : 0,
5796
5803
  arrowOffset: props.arrowOffset,
5797
5804
  arrowPosition: props.arrowPosition,
@@ -5874,7 +5881,7 @@ var PopoverDropdown = factory(({ children, className, style, ...others }, ref) =
5874
5881
  const { props, floating } = context;
5875
5882
  const dropdownRef = (0, import_react33.useRef)(null);
5876
5883
  useFocusTrap(dropdownRef, context.opened && !!props.trapFocus, props.returnFocus);
5877
- const width = props.width === "target" ? floating.referenceWidth : props.width === "auto" ? void 0 : rem(props.width);
5884
+ const width = props.width === "target" ? floating.referenceWidth > 0 ? floating.referenceWidth : void 0 : props.width === "auto" ? void 0 : rem(props.width);
5878
5885
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(OptionalPortal, { withinPortal: props.withinPortal, ...props.portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5879
5886
  Transition,
5880
5887
  {
@@ -5899,8 +5906,12 @@ var PopoverDropdown = factory(({ children, className, style, ...others }, ref) =
5899
5906
  ...transitionStyles2,
5900
5907
  ...dropdown.style,
5901
5908
  position: "fixed",
5909
+ // Clear any inherited inset from host CSS so left/top win.
5910
+ inset: "auto",
5902
5911
  top: floating.y,
5903
5912
  left: floating.x,
5913
+ right: "auto",
5914
+ bottom: "auto",
5904
5915
  width,
5905
5916
  zIndex: props.zIndex,
5906
5917
  // Invisible until measured, so it doesn't flash at 0,0.
@@ -8588,12 +8599,28 @@ function comparable(value) {
8588
8599
  if (typeof value === "object" && "id" in value) return String(value.id);
8589
8600
  return String(value);
8590
8601
  }
8602
+ function pickPlainLabel(raw2, fallback) {
8603
+ if (typeof raw2 === "string" || typeof raw2 === "number") return raw2;
8604
+ if ((0, import_react45.isValidElement)(raw2)) return raw2;
8605
+ if (raw2 && typeof raw2 === "object" && !Array.isArray(raw2)) {
8606
+ const map = raw2;
8607
+ for (const key of ["ar", "en", "label", "name", "title"]) {
8608
+ const hit = map[key];
8609
+ if (typeof hit === "string" && hit.trim()) return hit.trim();
8610
+ }
8611
+ for (const hit of Object.values(map)) {
8612
+ if (typeof hit === "string" && hit.trim()) return hit.trim();
8613
+ }
8614
+ }
8615
+ return fallback;
8616
+ }
8591
8617
  function toSelectItem(entry, keys) {
8592
8618
  const record = typeof entry === "object" ? entry : { value: entry, label: String(entry) };
8593
8619
  const value = comparable(record.value ?? record[keys.valueKey]);
8594
8620
  const raw2 = record.label ?? record[keys.labelKey];
8595
- const plain = typeof raw2 === "string" || typeof raw2 === "number" || (0, import_react45.isValidElement)(raw2) ? raw2 : value;
8596
- const node = keys.getOptionLabel ? keys.getOptionLabel(record) : plain;
8621
+ const plain = pickPlainLabel(raw2, value);
8622
+ const fromGetter = keys.getOptionLabel ? keys.getOptionLabel(record) : void 0;
8623
+ const node = fromGetter !== void 0 && fromGetter !== null && fromGetter !== "" ? fromGetter : plain;
8597
8624
  const text = typeof node === "string" || typeof node === "number" ? String(node) : typeof raw2 === "string" ? raw2 : value;
8598
8625
  const label = record.searchText ?? (typeof record.description === "string" ? `${text} ${record.description}` : text);
8599
8626
  return { value, label, node, display: record.displayLabel ?? node, disabled: record.disabled, option: entry, record };
@@ -9669,6 +9696,7 @@ var PhoneInput = factory((_props, ref) => {
9669
9696
  const shownPlaceholder = typeof placeholder === "function" ? placeholder(limit) : placeholder ?? (limit ? labels.phoneDigits(limit) : void 0);
9670
9697
  const layout = { m, mt, mb, ml, mr, ms, me, mx, my, w, miw, maw, flex };
9671
9698
  if (loading) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Skeleton, { height: 36, radius: 999, ...layout });
9699
+ const selectPropClassNames = typeof selectProps?.classNames === "object" && selectProps.classNames ? selectProps.classNames : {};
9672
9700
  const select = {
9673
9701
  value: code,
9674
9702
  emptyValue: "",
@@ -9677,10 +9705,36 @@ var PhoneInput = factory((_props, ref) => {
9677
9705
  placeholder: codePlaceholder,
9678
9706
  withFooter: false,
9679
9707
  radius: 0,
9680
- comboboxProps: { width: 240, position: "bottom-start", withinPortal: true },
9681
9708
  "aria-invalid": !!codeError || void 0,
9682
9709
  "aria-label": codePlaceholder,
9683
9710
  ...selectProps,
9711
+ // PhoneInput wins these after selectProps — dial codes stay LTR and compact.
9712
+ searchable: false,
9713
+ checkIconPosition: "right",
9714
+ classNames: {
9715
+ ...selectPropClassNames,
9716
+ dropdown: ["wello-PhoneInput-dropdown", selectPropClassNames.dropdown].filter(Boolean).join(" ")
9717
+ },
9718
+ attributes: {
9719
+ ...typeof selectProps?.attributes === "object" ? selectProps.attributes : {},
9720
+ // Physical LTR on the portaled node — portal root may still be dir=rtl from <html>.
9721
+ dropdown: {
9722
+ ...typeof selectProps?.attributes === "object" && selectProps.attributes?.dropdown || {},
9723
+ dir: "ltr"
9724
+ }
9725
+ },
9726
+ comboboxProps: {
9727
+ middlewares: { flip: true, shift: true },
9728
+ ...selectProps?.comboboxProps,
9729
+ // Physical left — never mirrors in RTL (start/end would).
9730
+ position: "bottom-left",
9731
+ // Shrink-wrap to flag+code; `target` was the narrow trigger and fought min-width.
9732
+ width: "auto",
9733
+ withinPortal: true,
9734
+ // overflow:hidden on the phone field must not hide the menu as "detached".
9735
+ hideDetached: false,
9736
+ dir: "ltr"
9737
+ },
9684
9738
  onChange: (next, option) => {
9685
9739
  const resolved = option?.resolved ?? null;
9686
9740
  if (resolved) setFetched(resolved);
@@ -10279,87 +10333,101 @@ var ColorInput = factory((_props, ref) => {
10279
10333
  const [eyeDropperSupported, setSupported] = (0, import_react49.useState)(false);
10280
10334
  (0, import_react49.useEffect)(() => setSupported(typeof window !== "undefined" && "EyeDropper" in window), []);
10281
10335
  const named = typeof size2 === "string" ? size2 : "sm";
10282
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Popover, { position: "bottom-start", offset: 5, opened, width: fullWidth ? "target" : void 0, transitionProps: { duration: 0 }, ...popoverProps, withRoles: false, disabled: readOnly || withPicker === false && !swatches?.length, children: [
10283
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverTarget, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10284
- InputBase,
10285
- {
10286
- autoComplete: "off",
10287
- spellCheck: false,
10288
- ...others,
10289
- __staticSelector: "ColorInput",
10290
- ref,
10291
- classNames: partClasses,
10292
- styles: partStyles,
10293
- unstyled,
10294
- size: size2,
10295
- disabled,
10296
- readOnly: disallowInput || readOnly,
10297
- pointer: disallowInput,
10298
- value: current,
10299
- onFocus: (event) => {
10300
- onFocus?.(event);
10301
- setOpened(true);
10302
- },
10303
- onBlur: (event) => {
10304
- if (fixOnBlur && current !== lastValid.current) setValue(lastValid.current);
10305
- onBlur?.(event);
10306
- setOpened(false);
10307
- },
10308
- onClick: (event) => {
10309
- onClick2?.(event);
10310
- setOpened(true);
10311
- },
10312
- onChange: (event) => {
10313
- const next = event.currentTarget.value;
10314
- setValue(next);
10315
- if (isColorValid(next)) onChangeEnd?.(convertHsvaTo(format, parseColor(next)));
10316
- },
10317
- leftSection: leftSection || (withPreview ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ColorSwatch, { color: isColorValid(current) ? current : "#fff", size: PREVIEW_SIZE[named] ?? 18, ...getStyles("colorPreview") }) : null),
10318
- rightSectionPointerEvents: "auto",
10319
- rightSection: rightSection || (withEyeDropper && !disabled && !readOnly && eyeDropperSupported ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10320
- ActionIcon,
10336
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
10337
+ Popover,
10338
+ {
10339
+ position: "bottom-start",
10340
+ offset: 5,
10341
+ opened,
10342
+ width: fullWidth ? "target" : void 0,
10343
+ transitionProps: { duration: 0 },
10344
+ ...popoverProps,
10345
+ dir: popoverProps?.dir ?? "ltr",
10346
+ withRoles: false,
10347
+ disabled: readOnly || withPicker === false && !swatches?.length,
10348
+ children: [
10349
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverTarget, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10350
+ InputBase,
10321
10351
  {
10322
- "aria-label": labels.colorEyeDropper,
10323
- ...eyeDropperButtonProps,
10324
- ...getStyles("eyeDropperButton"),
10325
- variant: "subtle",
10326
- color: "gray",
10327
- onMouseDown: (event) => event.preventDefault(),
10328
- onClick: () => {
10329
- const EyeDropper = window.EyeDropper;
10330
- new EyeDropper().open().then(({ sRGBHex }) => {
10331
- const color2 = convertHsvaTo(format, parseColor(sRGBHex));
10332
- setValue(color2);
10333
- onChangeEnd?.(color2);
10334
- }).catch(() => void 0);
10352
+ autoComplete: "off",
10353
+ spellCheck: false,
10354
+ ...others,
10355
+ __staticSelector: "ColorInput",
10356
+ ref,
10357
+ classNames: partClasses,
10358
+ styles: partStyles,
10359
+ unstyled,
10360
+ size: size2,
10361
+ disabled,
10362
+ readOnly: disallowInput || readOnly,
10363
+ pointer: disallowInput,
10364
+ value: current,
10365
+ onFocus: (event) => {
10366
+ onFocus?.(event);
10367
+ setOpened(true);
10368
+ },
10369
+ onBlur: (event) => {
10370
+ if (fixOnBlur && current !== lastValid.current) setValue(lastValid.current);
10371
+ onBlur?.(event);
10372
+ setOpened(false);
10335
10373
  },
10336
- children: eyeDropperIcon || /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(EyeDropperIcon, { size: ICON_SIZE[named] ?? 16, ...getStyles("eyeDropperIcon") })
10374
+ onClick: (event) => {
10375
+ onClick2?.(event);
10376
+ setOpened(true);
10377
+ },
10378
+ onChange: (event) => {
10379
+ const next = event.currentTarget.value;
10380
+ setValue(next);
10381
+ if (isColorValid(next)) onChangeEnd?.(convertHsvaTo(format, parseColor(next)));
10382
+ },
10383
+ leftSection: leftSection || (withPreview ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ColorSwatch, { color: isColorValid(current) ? current : "#fff", size: PREVIEW_SIZE[named] ?? 18, ...getStyles("colorPreview") }) : null),
10384
+ rightSectionPointerEvents: "auto",
10385
+ rightSection: rightSection || (withEyeDropper && !disabled && !readOnly && eyeDropperSupported ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10386
+ ActionIcon,
10387
+ {
10388
+ "aria-label": labels.colorEyeDropper,
10389
+ ...eyeDropperButtonProps,
10390
+ ...getStyles("eyeDropperButton"),
10391
+ variant: "subtle",
10392
+ color: "gray",
10393
+ onMouseDown: (event) => event.preventDefault(),
10394
+ onClick: () => {
10395
+ const EyeDropper = window.EyeDropper;
10396
+ new EyeDropper().open().then(({ sRGBHex }) => {
10397
+ const color2 = convertHsvaTo(format, parseColor(sRGBHex));
10398
+ setValue(color2);
10399
+ onChangeEnd?.(color2);
10400
+ }).catch(() => void 0);
10401
+ },
10402
+ children: eyeDropperIcon || /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(EyeDropperIcon, { size: ICON_SIZE[named] ?? 16, ...getStyles("eyeDropperIcon") })
10403
+ }
10404
+ ) : null)
10337
10405
  }
10338
- ) : null)
10339
- }
10340
- ) }),
10341
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverDropdown, { ...getStyles("dropdown"), onMouseDown: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10342
- ColorPicker,
10343
- {
10344
- value: current,
10345
- onChange: setValue,
10346
- onChangeEnd,
10347
- format,
10348
- swatches,
10349
- swatchesPerRow,
10350
- withPicker,
10351
- size: size2,
10352
- focusable: false,
10353
- unstyled,
10354
- classNames: partClasses,
10355
- styles: partStyles,
10356
- fullWidth,
10357
- onColorSwatchClick: () => {
10358
- if (closeOnColorSwatchClick) setOpened(false);
10359
- }
10360
- }
10361
- ) })
10362
- ] });
10406
+ ) }),
10407
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverDropdown, { ...getStyles("dropdown"), onMouseDown: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10408
+ ColorPicker,
10409
+ {
10410
+ value: current,
10411
+ onChange: setValue,
10412
+ onChangeEnd,
10413
+ format,
10414
+ swatches,
10415
+ swatchesPerRow,
10416
+ withPicker,
10417
+ size: size2,
10418
+ focusable: false,
10419
+ unstyled,
10420
+ classNames: partClasses,
10421
+ styles: partStyles,
10422
+ fullWidth,
10423
+ onColorSwatchClick: () => {
10424
+ if (closeOnColorSwatchClick) setOpened(false);
10425
+ }
10426
+ }
10427
+ ) })
10428
+ ]
10429
+ }
10430
+ );
10363
10431
  });
10364
10432
  ColorInput.displayName = "ColorInput";
10365
10433