@algorithm-shift/design-system 1.3.117 → 1.3.118

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,44 +2530,38 @@ 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) => {
2538
- if (!val) return "";
2539
- const trimmed = val.trim();
2540
- if (trimmed.startsWith("+")) return trimmed;
2541
- const local = trimmed.replace(/^0+/, "");
2542
- return `+91${local}`;
2543
- };
2544
2537
  var PhoneInput = ({ className, style, ...props }) => {
2538
+ const ref = useRef6(null);
2545
2539
  const placeholder = props.placeholder ?? "Enter phone number";
2546
2540
  const isEditable = props.isEditable ?? true;
2547
2541
  const isDisabled = props.isDisabled ?? false;
2548
2542
  useEffect18(() => {
2549
2543
  if (props.value !== void 0) {
2550
- const normalized = ensureIndiaCode(props.value);
2551
- handleChange?.(normalized);
2544
+ handleChange?.(props.value, ref.current?.state);
2552
2545
  }
2553
2546
  }, []);
2554
- const handleChange = (val) => {
2555
- const normalized = ensureIndiaCode(val);
2547
+ const handleChange = (value, meta) => {
2556
2548
  const event = {
2557
2549
  target: {
2558
2550
  name: props.name || "",
2559
- value: normalized
2551
+ value
2560
2552
  }
2561
2553
  };
2562
2554
  props.onChange?.(event, props.name || "");
2555
+ props.getPhoneState?.(meta);
2563
2556
  };
2564
2557
  return /* @__PURE__ */ jsxs22(Fragment14, { children: [
2565
2558
  /* @__PURE__ */ jsx40(
2566
2559
  PhoneInputField,
2567
2560
  {
2561
+ ref,
2568
2562
  defaultCountry: "in",
2569
2563
  name: props.name,
2570
- value: props.value ? ensureIndiaCode(props.value) : "",
2564
+ value: props.value ? props.value : "",
2571
2565
  className: cn(
2572
2566
  "rounded-md border-1",
2573
2567
  className,
@@ -3365,7 +3359,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
3365
3359
  var TextInputGroup_default = TextInputGroup;
3366
3360
 
3367
3361
  // src/components/Inputs/Multiselect/MultiSelect.tsx
3368
- import { useState as useState10, useRef as useRef7, useEffect as useEffect25, useMemo as useMemo6 } from "react";
3362
+ import { useState as useState10, useRef as useRef8, useEffect as useEffect25, useMemo as useMemo6 } from "react";
3369
3363
  import { XIcon, XSquareIcon as XSquareIcon3 } from "lucide-react";
3370
3364
  import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
3371
3365
  function LazyMultiSelectDropdown({
@@ -3388,8 +3382,8 @@ function LazyMultiSelectDropdown({
3388
3382
  }) {
3389
3383
  const [isOpen, setIsOpen] = useState10(false);
3390
3384
  const [searchTerm, setSearchTerm] = useState10("");
3391
- const dropdownRef = useRef7(null);
3392
- const observerTarget = useRef7(null);
3385
+ const dropdownRef = useRef8(null);
3386
+ const observerTarget = useRef8(null);
3393
3387
  const ensureUnique = (arr) => {
3394
3388
  return Array.from(new Set(arr));
3395
3389
  };
@@ -5613,7 +5607,7 @@ var StagesComponent = ({
5613
5607
  const lastStage = stages && stages.length > 0 ? stages[stages.length - 1][dataKey] : null;
5614
5608
  const isMobile = canvasMode === "mobile";
5615
5609
  const onStageClick = (stageKey) => {
5616
- if (!stageKey || stageKey === activeStage || activeStage === lastStage) return;
5610
+ if (!stageKey || stageKey === activeStage) return;
5617
5611
  setActiveStage(stageKey);
5618
5612
  if (triggerOnClick) {
5619
5613
  onStageChange?.(stageKey);