@algorithm-shift/design-system 1.3.117 → 1.3.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2530,11 +2530,11 @@ var SwitchToggle = ({ className, style, ...props }) => {
2530
2530
  var SwitchToggle_default = SwitchToggle;
2531
2531
 
2532
2532
  // src/components/Inputs/PhoneInput/PhoneInput.tsx
2533
- import { useEffect as useEffect18 } from "react";
2533
+ import { useEffect as useEffect18, useRef as useRef6 } from "react";
2534
2534
  import { PhoneInput as PhoneInputField } from "react-international-phone";
2535
2535
  import "react-international-phone/style.css";
2536
2536
  import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
2537
- var ensureIndiaCode = (val) => {
2537
+ var ensureDialcode = (val) => {
2538
2538
  if (!val) return "";
2539
2539
  const trimmed = val.trim();
2540
2540
  if (trimmed.startsWith("+")) return trimmed;
@@ -2542,32 +2542,33 @@ var ensureIndiaCode = (val) => {
2542
2542
  return `+91${local}`;
2543
2543
  };
2544
2544
  var PhoneInput = ({ className, style, ...props }) => {
2545
+ const ref = useRef6(null);
2545
2546
  const placeholder = props.placeholder ?? "Enter phone number";
2546
2547
  const isEditable = props.isEditable ?? true;
2547
2548
  const isDisabled = props.isDisabled ?? false;
2548
2549
  useEffect18(() => {
2549
2550
  if (props.value !== void 0) {
2550
- const normalized = ensureIndiaCode(props.value);
2551
- handleChange?.(normalized);
2551
+ handleChange?.(ensureDialcode(props.value), ref.current?.state);
2552
2552
  }
2553
2553
  }, []);
2554
- const handleChange = (val) => {
2555
- const normalized = ensureIndiaCode(val);
2554
+ const handleChange = (value, meta) => {
2556
2555
  const event = {
2557
2556
  target: {
2558
2557
  name: props.name || "",
2559
- value: normalized
2558
+ value
2560
2559
  }
2561
2560
  };
2562
2561
  props.onChange?.(event, props.name || "");
2562
+ props.getPhoneState?.(meta);
2563
2563
  };
2564
2564
  return /* @__PURE__ */ jsxs22(Fragment14, { children: [
2565
2565
  /* @__PURE__ */ jsx40(
2566
2566
  PhoneInputField,
2567
2567
  {
2568
- defaultCountry: "in",
2568
+ ref,
2569
+ defaultCountry: props.defaultCountry || "in",
2569
2570
  name: props.name,
2570
- value: props.value ? ensureIndiaCode(props.value) : "",
2571
+ value: props.value ? ensureDialcode(props.value) : "",
2571
2572
  className: cn(
2572
2573
  "rounded-md border-1",
2573
2574
  className,
@@ -3365,7 +3366,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
3365
3366
  var TextInputGroup_default = TextInputGroup;
3366
3367
 
3367
3368
  // src/components/Inputs/Multiselect/MultiSelect.tsx
3368
- import { useState as useState10, useRef as useRef7, useEffect as useEffect25, useMemo as useMemo6 } from "react";
3369
+ import { useState as useState10, useRef as useRef8, useEffect as useEffect25, useMemo as useMemo6 } from "react";
3369
3370
  import { XIcon, XSquareIcon as XSquareIcon3 } from "lucide-react";
3370
3371
  import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
3371
3372
  function LazyMultiSelectDropdown({
@@ -3388,8 +3389,8 @@ function LazyMultiSelectDropdown({
3388
3389
  }) {
3389
3390
  const [isOpen, setIsOpen] = useState10(false);
3390
3391
  const [searchTerm, setSearchTerm] = useState10("");
3391
- const dropdownRef = useRef7(null);
3392
- const observerTarget = useRef7(null);
3392
+ const dropdownRef = useRef8(null);
3393
+ const observerTarget = useRef8(null);
3393
3394
  const ensureUnique = (arr) => {
3394
3395
  return Array.from(new Set(arr));
3395
3396
  };
@@ -5613,7 +5614,7 @@ var StagesComponent = ({
5613
5614
  const lastStage = stages && stages.length > 0 ? stages[stages.length - 1][dataKey] : null;
5614
5615
  const isMobile = canvasMode === "mobile";
5615
5616
  const onStageClick = (stageKey) => {
5616
- if (!stageKey || stageKey === activeStage || activeStage === lastStage) return;
5617
+ if (!stageKey || stageKey === activeStage) return;
5617
5618
  setActiveStage(stageKey);
5618
5619
  if (triggerOnClick) {
5619
5620
  onStageChange?.(stageKey);