@agility/plenum-ui 2.0.0-rc6 → 2.0.0-rc8

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 (30) hide show
  1. package/dist/index.d.ts +129 -43
  2. package/dist/index.js +283 -96
  3. package/dist/index.js.map +4 -4
  4. package/dist/lib/tailwind.css +33 -8
  5. package/dist/types/stories/index.d.ts +4 -4
  6. package/dist/types/stories/molecules/index.d.ts +3 -3
  7. package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +1 -1
  8. package/dist/types/stories/molecules/inputs/index.d.ts +3 -3
  9. package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +30 -21
  10. package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
  11. package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
  12. package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +2 -2
  13. package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
  14. package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
  15. package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
  16. package/dist/types/stories/organisms/index.d.ts +3 -2
  17. package/package.json +1 -1
  18. package/stories/index.ts +10 -6
  19. package/stories/molecules/index.ts +4 -4
  20. package/stories/molecules/inputs/InputField/InputField.tsx +1 -0
  21. package/stories/molecules/inputs/index.ts +3 -3
  22. package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
  23. package/stories/molecules/inputs/textArea/TextArea.tsx +110 -49
  24. package/stories/molecules/inputs/textArea/index.ts +3 -3
  25. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +3 -3
  26. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
  27. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
  28. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
  29. package/stories/organisms/TextInputSelect/index.tsx +3 -0
  30. package/stories/organisms/index.ts +4 -2
package/dist/index.js CHANGED
@@ -5371,74 +5371,114 @@ var Select_default = Select;
5371
5371
  var select_default = Select_default;
5372
5372
 
5373
5373
  // stories/molecules/inputs/textArea/TextArea.tsx
5374
+ import React16, { useEffect as useEffect3, useId as useId2, useState as useState4 } from "react";
5374
5375
  import { default as cn16 } from "classnames";
5375
- var TextAreaField = (_a) => {
5376
+
5377
+ // stories/molecules/inputs/InputCounter/InputCounter.tsx
5378
+ import React15 from "react";
5379
+ var InputCounter = ({ current = 0, limit }) => {
5380
+ return /* @__PURE__ */ React15.createElement("div", { className: "mt-1 text-center text-sm text-gray-500 flex gap-1" }, /* @__PURE__ */ React15.createElement("div", { className: "currentCount" }, current), (limit || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", null, "/"), /* @__PURE__ */ React15.createElement("div", { className: "limitCount" }, limit)));
5381
+ };
5382
+ var InputCounter_default = InputCounter;
5383
+
5384
+ // stories/molecules/inputs/textArea/TextArea.tsx
5385
+ var Textarea = (_a) => {
5376
5386
  var _b = _a, {
5377
5387
  id: id2,
5378
5388
  name,
5379
- value,
5380
- isFocused,
5389
+ label,
5381
5390
  isError,
5382
- isReadonly,
5391
+ isRequired,
5383
5392
  isDisabled,
5384
- handleChange,
5385
- required,
5393
+ defaultValue,
5394
+ message,
5395
+ isShowCounter,
5396
+ maxLength,
5397
+ rows = 12,
5398
+ cols = 48,
5399
+ onChange,
5400
+ value: externalValue,
5386
5401
  placeholder,
5387
- className
5402
+ className,
5403
+ ref
5388
5404
  } = _b, rest = __objRest(_b, [
5389
5405
  "id",
5390
5406
  "name",
5391
- "value",
5392
- "isFocused",
5407
+ "label",
5393
5408
  "isError",
5394
- "isReadonly",
5409
+ "isRequired",
5395
5410
  "isDisabled",
5396
- "handleChange",
5397
- "required",
5411
+ "defaultValue",
5412
+ "message",
5413
+ "isShowCounter",
5414
+ "maxLength",
5415
+ "rows",
5416
+ "cols",
5417
+ "onChange",
5418
+ "value",
5398
5419
  "placeholder",
5399
- "className"
5420
+ "className",
5421
+ "ref"
5400
5422
  ]);
5401
- return /* @__PURE__ */ React.createElement(
5402
- "textarea",
5403
- __spreadValues({}, __spreadValues({
5423
+ const uniqueID = useId2();
5424
+ const [value, setValue] = useState4(externalValue || defaultValue || "");
5425
+ const handleOnchange = (e) => {
5426
+ const targetValue = e.currentTarget.value;
5427
+ typeof onChange === "function" && onChange(targetValue);
5428
+ setValue(targetValue);
5429
+ };
5430
+ const discriptionStyles = cn16("text-sm mt-1 block", { "text-gray-500": !isError }, { "text-red-500": isError });
5431
+ useEffect3(() => {
5432
+ if (externalValue !== void 0 && externalValue !== null) {
5433
+ setValue(externalValue);
5434
+ }
5435
+ }, [externalValue]);
5436
+ if (!id2)
5437
+ id2 = `ta-${uniqueID}`;
5438
+ return /* @__PURE__ */ React16.createElement("div", null, label && /* @__PURE__ */ React16.createElement(
5439
+ InputLabel_default2,
5440
+ {
5441
+ isPlaceholder: true,
5442
+ isActive: true,
5443
+ label,
5444
+ isRequired,
5404
5445
  id: id2,
5446
+ isError,
5447
+ isDisabled
5448
+ }
5449
+ ), /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement(
5450
+ "textarea",
5451
+ __spreadValues({
5452
+ ref,
5453
+ maxLength,
5454
+ onChange: handleOnchange,
5455
+ rows,
5405
5456
  name,
5406
- value,
5407
- onChange: (e) => {
5408
- handleChange(e.target.value);
5409
- },
5410
- autoFocus: isFocused,
5411
- readOnly: isReadonly,
5412
- disabled: isDisabled,
5413
- required,
5414
- placeholder: placeholder || " ",
5415
- "aria-invalid": isError,
5416
- "aria-disabled": isDisabled,
5457
+ id: id2,
5458
+ cols,
5417
5459
  className: cn16(
5418
- "peer w-full resize-y auto-resize rounded border border-gray-300 py-2 px-3 pt-2 text-sm font-normal leading-5 outline-offset-0 ring-offset-0 focus:border-purple-600 focus:ring-purple-600",
5419
- isError ? "border-red-600 text-red-600" : "",
5460
+ "block w-full rounded focus:border-purple-500 focus:ring-purple-500 sm:text-sm",
5461
+ { "border-gray-300 ": !isError },
5462
+ {
5463
+ "border-red-500 outline-red-500 focus:ring-red-500": isError
5464
+ },
5420
5465
  className
5421
- )
5422
- }, rest))
5423
- );
5466
+ ),
5467
+ disabled: isDisabled,
5468
+ defaultValue,
5469
+ value,
5470
+ placeholder
5471
+ }, rest)
5472
+ )), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React16.createElement("div", { className: "grow" }, message && /* @__PURE__ */ React16.createElement("span", { className: discriptionStyles }, message)), isShowCounter && /* @__PURE__ */ React16.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React16.createElement(InputCounter_default, { current: Number(value == null ? void 0 : value.length), limit: maxLength }))));
5424
5473
  };
5425
- var TextArea_default = TextAreaField;
5474
+ var TextArea_default = Textarea;
5426
5475
 
5427
5476
  // stories/molecules/inputs/textArea/index.ts
5428
5477
  var textArea_default = TextArea_default;
5429
5478
 
5430
5479
  // stories/molecules/inputs/TextInput/TextInput.tsx
5431
- import React16, { forwardRef, useEffect as useEffect3, useId as useId2, useRef, useState as useState4 } from "react";
5480
+ import React17, { forwardRef as forwardRef2, useEffect as useEffect4, useId as useId3, useRef, useState as useState5 } from "react";
5432
5481
  import { default as cn17 } from "classnames";
5433
-
5434
- // stories/molecules/inputs/InputCounter/InputCounter.tsx
5435
- import React15 from "react";
5436
- var InputCounter = ({ current = 0, limit }) => {
5437
- return /* @__PURE__ */ React15.createElement("div", { className: "mt-1 text-center text-sm text-gray-500 flex gap-1" }, /* @__PURE__ */ React15.createElement("div", { className: "currentCount" }, current), (limit || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", null, "/"), /* @__PURE__ */ React15.createElement("div", { className: "limitCount" }, limit)));
5438
- };
5439
- var InputCounter_default = InputCounter;
5440
-
5441
- // stories/molecules/inputs/TextInput/TextInput.tsx
5442
5482
  var TextInput = (_a, ref) => {
5443
5483
  var _b = _a, {
5444
5484
  label,
@@ -5477,16 +5517,16 @@ var TextInput = (_a, ref) => {
5477
5517
  "value",
5478
5518
  "className"
5479
5519
  ]);
5480
- const uniqueID = useId2();
5481
- const [isFocus, setIsFocus] = useState4(Boolean(isFocused));
5482
- const [value, setValue] = useState4(externalValue || defaultValue || "");
5520
+ const uniqueID = useId3();
5521
+ const [isFocus, setIsFocus] = useState5(Boolean(isFocused));
5522
+ const [value, setValue] = useState5(externalValue || defaultValue || "");
5483
5523
  const inputRef = useRef(null);
5484
- useEffect3(() => {
5524
+ useEffect4(() => {
5485
5525
  if (externalValue !== void 0 && externalValue !== null) {
5486
5526
  setValue(externalValue);
5487
5527
  }
5488
5528
  }, [externalValue]);
5489
- useEffect3(() => {
5529
+ useEffect4(() => {
5490
5530
  const input = inputRef.current;
5491
5531
  if (!input || isFocus === void 0 || isDisabled)
5492
5532
  return;
@@ -5496,7 +5536,7 @@ var TextInput = (_a, ref) => {
5496
5536
  input.blur();
5497
5537
  }
5498
5538
  }, [isFocus]);
5499
- useEffect3(() => {
5539
+ useEffect4(() => {
5500
5540
  const input = inputRef.current;
5501
5541
  if (!input || defaultValue === void 0 || defaultValue === "")
5502
5542
  return;
@@ -5507,7 +5547,7 @@ var TextInput = (_a, ref) => {
5507
5547
  id2 = `input-${uniqueID}`;
5508
5548
  if (!name)
5509
5549
  name = id2;
5510
- return /* @__PURE__ */ React16.createElement("div", { className: "relative" }, /* @__PURE__ */ React16.createElement(
5550
+ return /* @__PURE__ */ React17.createElement("div", { className: "relative" }, /* @__PURE__ */ React17.createElement(
5511
5551
  InputLabel_default2,
5512
5552
  {
5513
5553
  isPlaceholder: true,
@@ -5518,7 +5558,7 @@ var TextInput = (_a, ref) => {
5518
5558
  isActive: true,
5519
5559
  isDisabled
5520
5560
  }
5521
- ), /* @__PURE__ */ React16.createElement(
5561
+ ), /* @__PURE__ */ React17.createElement(
5522
5562
  InputField_default2,
5523
5563
  __spreadValues({
5524
5564
  onFocus: handleInputFocus,
@@ -5546,16 +5586,16 @@ var TextInput = (_a, ref) => {
5546
5586
  maxLength,
5547
5587
  placeholder
5548
5588
  }, props)
5549
- ), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React16.createElement("div", { className: "grow" }, message && /* @__PURE__ */ React16.createElement("span", { className: cn17("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500") }, message)), isShowCounter && /* @__PURE__ */ React16.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React16.createElement(InputCounter_default, { current: Number(value == null ? void 0 : value.length), limit: maxLength }))));
5589
+ ), /* @__PURE__ */ React17.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React17.createElement("div", { className: "grow" }, message && /* @__PURE__ */ React17.createElement("span", { className: cn17("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500") }, message)), isShowCounter && /* @__PURE__ */ React17.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React17.createElement(InputCounter_default, { current: Number(value == null ? void 0 : value.length), limit: maxLength }))));
5550
5590
  };
5551
- var _TextInput = forwardRef(TextInput);
5591
+ var _TextInput = forwardRef2(TextInput);
5552
5592
  var TextInput_default = _TextInput;
5553
5593
 
5554
5594
  // stories/molecules/inputs/TextInput/index.tsx
5555
5595
  var TextInput_default2 = TextInput_default;
5556
5596
 
5557
5597
  // stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx
5558
- import React17, { useEffect as useEffect4, useState as useState5 } from "react";
5598
+ import React18, { useEffect as useEffect5, useState as useState6 } from "react";
5559
5599
  import { default as cn18 } from "classnames";
5560
5600
  import { Switch } from "@headlessui/react";
5561
5601
  var ToggleSwitch = ({
@@ -5568,9 +5608,9 @@ var ToggleSwitch = ({
5568
5608
  variant = "base",
5569
5609
  withIcon
5570
5610
  }) => {
5571
- const [checked, setChecked] = useState5(isChecked);
5572
- useEffect4(() => setChecked(isChecked), [isChecked]);
5573
- return /* @__PURE__ */ React17.createElement(Switch.Group, { as: "div", className: "flex items-center gap-2" }, label && label.xPosition === "left" && /* @__PURE__ */ React17.createElement(Switch.Label, { className: label.className }, label.text), /* @__PURE__ */ React17.createElement(
5611
+ const [checked, setChecked] = useState6(isChecked);
5612
+ useEffect5(() => setChecked(isChecked), [isChecked]);
5613
+ return /* @__PURE__ */ React18.createElement(Switch.Group, { as: "div", className: "flex items-center gap-2" }, label && label.xPosition === "left" && /* @__PURE__ */ React18.createElement(Switch.Label, { className: label.className }, label.text), /* @__PURE__ */ React18.createElement(
5574
5614
  Switch,
5575
5615
  {
5576
5616
  name,
@@ -5586,8 +5626,8 @@ var ToggleSwitch = ({
5586
5626
  "relative inline-flex items-center rounded-full focus-visible:ring-2 focus-visible:ring-purple-600 focus-visible:ring-offset-2 focus-within:ring-2 focus-within:ring-purple-600 focus-within:ring-offset-2 focus:ring-2 focus:ring-purple-600 focus:ring-offset-2 active:ring-2 active:ring-purple-600 active:ring-offset-2"
5587
5627
  )
5588
5628
  },
5589
- /* @__PURE__ */ React17.createElement("span", { className: "sr-only" }, screenReaderLabel),
5590
- /* @__PURE__ */ React17.createElement(
5629
+ /* @__PURE__ */ React18.createElement("span", { className: "sr-only" }, screenReaderLabel),
5630
+ /* @__PURE__ */ React18.createElement(
5591
5631
  "span",
5592
5632
  {
5593
5633
  className: cn18(
@@ -5599,9 +5639,9 @@ var ToggleSwitch = ({
5599
5639
  " h-5 w-5 transform rounded-full bg-white transition shadow-sm drop-shadow flex items-center justify-center"
5600
5640
  )
5601
5641
  },
5602
- withIcon && /* @__PURE__ */ React17.createElement(DynamicIcon, __spreadProps(__spreadValues({}, withIcon), { className: "text-gray-400 m-[2px]" }))
5642
+ withIcon && /* @__PURE__ */ React18.createElement(DynamicIcon, __spreadProps(__spreadValues({}, withIcon), { className: "text-gray-400 m-[2px]" }))
5603
5643
  )
5604
- ), label && label.xPosition === "right" && /* @__PURE__ */ React17.createElement(Switch.Label, { className: label.className }, label.text));
5644
+ ), label && label.xPosition === "right" && /* @__PURE__ */ React18.createElement(Switch.Label, { className: label.className }, label.text));
5605
5645
  };
5606
5646
  var ToggleSwitch_default = ToggleSwitch;
5607
5647
 
@@ -5609,7 +5649,7 @@ var ToggleSwitch_default = ToggleSwitch;
5609
5649
  var toggleSwitch_default = ToggleSwitch_default;
5610
5650
 
5611
5651
  // stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx
5612
- import React18 from "react";
5652
+ import React19 from "react";
5613
5653
  import { default as cn19 } from "classnames";
5614
5654
  var AnimatedLabelInput = ({
5615
5655
  id: id2,
@@ -5621,7 +5661,7 @@ var AnimatedLabelInput = ({
5621
5661
  isError,
5622
5662
  containerStyles
5623
5663
  }) => {
5624
- return /* @__PURE__ */ React18.createElement("div", { className: cn19("group relative", containerStyles ? containerStyles : "") }, input && /* @__PURE__ */ React18.createElement(InputField_default2, __spreadValues({ isError }, input)), textarea && /* @__PURE__ */ React18.createElement(TextArea_default, __spreadValues({ isError }, textarea)), /* @__PURE__ */ React18.createElement(
5664
+ return /* @__PURE__ */ React19.createElement("div", { className: cn19("group relative", containerStyles ? containerStyles : "") }, input && /* @__PURE__ */ React19.createElement(InputField_default2, __spreadValues({ isError }, input)), textarea && /* @__PURE__ */ React19.createElement(TextArea_default, __spreadValues({ isError }, textarea)), /* @__PURE__ */ React19.createElement(
5625
5665
  "label",
5626
5666
  {
5627
5667
  className: cn19(
@@ -5632,8 +5672,8 @@ var AnimatedLabelInput = ({
5632
5672
  htmlFor: id2
5633
5673
  },
5634
5674
  label.display,
5635
- required && /* @__PURE__ */ React18.createElement("span", { className: "text-red-600" }, "*")
5636
- ), /* @__PURE__ */ React18.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React18.createElement("div", { className: "grow transition-all" }, message && /* @__PURE__ */ React18.createElement("span", { className: cn19("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500") }, message))));
5675
+ required && /* @__PURE__ */ React19.createElement("span", { className: "text-red-600" }, "*")
5676
+ ), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React19.createElement("div", { className: "grow transition-all" }, message && /* @__PURE__ */ React19.createElement("span", { className: cn19("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500") }, message))));
5637
5677
  };
5638
5678
  var AnimatedLabelInput_default = AnimatedLabelInput;
5639
5679
 
@@ -5641,11 +5681,11 @@ var AnimatedLabelInput_default = AnimatedLabelInput;
5641
5681
  var AnimatedLabelInput_default2 = AnimatedLabelInput_default;
5642
5682
 
5643
5683
  // stories/organisms/ButtonDropdown/ButtonDropdown.tsx
5644
- import React20 from "react";
5684
+ import React21 from "react";
5645
5685
  import { default as cn21 } from "classnames";
5646
5686
 
5647
5687
  // stories/organisms/DropdownComponent/DropdownComponent.tsx
5648
- import React19, { Fragment, useState as useState6 } from "react";
5688
+ import React20, { Fragment, useState as useState7 } from "react";
5649
5689
  import { Transition } from "@headlessui/react";
5650
5690
  import { default as cn20 } from "classnames";
5651
5691
  import {
@@ -5688,8 +5728,8 @@ var Dropdown = (_a) => {
5688
5728
  "offsetOptions"
5689
5729
  ]);
5690
5730
  var _a2, _b2;
5691
- const [isOpen, setIsOpen] = useState6(false);
5692
- const [activeItem, setActiveItem] = useState6(null);
5731
+ const [isOpen, setIsOpen] = useState7(false);
5732
+ const [activeItem, setActiveItem] = useState7(null);
5693
5733
  const { refs, floatingStyles, context } = useFloating({
5694
5734
  open: isOpen,
5695
5735
  onOpenChange: setIsOpen,
@@ -5720,7 +5760,7 @@ var Dropdown = (_a) => {
5720
5760
  }
5721
5761
  });
5722
5762
  const { groupClassname, buttonClassname, itemsClassname, itemClassname, activeItemClassname } = classNames3;
5723
- return /* @__PURE__ */ React19.createElement(
5763
+ return /* @__PURE__ */ React20.createElement(
5724
5764
  "div",
5725
5765
  __spreadValues({}, __spreadValues({
5726
5766
  className: groupClassname,
@@ -5729,7 +5769,7 @@ var Dropdown = (_a) => {
5729
5769
  "aria-expanded": isOpen,
5730
5770
  "aria-haspopup": "listbox"
5731
5771
  }, props)),
5732
- /* @__PURE__ */ React19.createElement(
5772
+ /* @__PURE__ */ React20.createElement(
5733
5773
  "button",
5734
5774
  __spreadValues({}, __spreadValues({
5735
5775
  ref: refs.setReference,
@@ -5738,9 +5778,9 @@ var Dropdown = (_a) => {
5738
5778
  setIsOpen(!isOpen);
5739
5779
  }
5740
5780
  }, getReferenceProps())),
5741
- CustomDropdownTrigger ? /* @__PURE__ */ React19.createElement("span", { className: "" }, CustomDropdownTrigger) : /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("span", { className: "pl-1" }, label), /* @__PURE__ */ React19.createElement(DynamicIcon, { icon: "ChevronDownIcon", className: "ml-1 h-5 w-6 " }))
5781
+ CustomDropdownTrigger ? /* @__PURE__ */ React20.createElement("span", { className: "" }, CustomDropdownTrigger) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("span", { className: "pl-1" }, label), /* @__PURE__ */ React20.createElement(DynamicIcon, { icon: "ChevronDownIcon", className: "ml-1 h-5 w-6 " }))
5742
5782
  ),
5743
- isMounted && items.length > 0 && isOpen && /* @__PURE__ */ React19.createElement(FloatingPortal, null, /* @__PURE__ */ React19.createElement(FloatingFocusManager, { context, modal: true }, /* @__PURE__ */ React19.createElement(
5783
+ isMounted && items.length > 0 && isOpen && /* @__PURE__ */ React20.createElement(FloatingPortal, null, /* @__PURE__ */ React20.createElement(FloatingFocusManager, { context, modal: true }, /* @__PURE__ */ React20.createElement(
5744
5784
  Transition,
5745
5785
  {
5746
5786
  as: Fragment,
@@ -5752,7 +5792,7 @@ var Dropdown = (_a) => {
5752
5792
  leaveFrom: "transform opacity-100 scale-100",
5753
5793
  leaveTo: "transform opacity-0 scale-95"
5754
5794
  },
5755
- /* @__PURE__ */ React19.createElement(
5795
+ /* @__PURE__ */ React20.createElement(
5756
5796
  "ul",
5757
5797
  __spreadValues(__spreadProps(__spreadValues({}, __spreadProps(__spreadValues({}, getFloatingProps()), {
5758
5798
  className: itemsClassname,
@@ -5774,7 +5814,7 @@ var Dropdown = (_a) => {
5774
5814
  "aria-labelledby": label
5775
5815
  }), getFloatingProps()),
5776
5816
  items.map((itemStack, idx) => {
5777
- return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: `${idx}-list-${id2}` }, itemStack.map(
5817
+ return /* @__PURE__ */ React20.createElement(React20.Fragment, { key: `${idx}-list-${id2}` }, itemStack.map(
5778
5818
  (_a3) => {
5779
5819
  var _b3 = _a3, {
5780
5820
  onClick,
@@ -5810,7 +5850,7 @@ var Dropdown = (_a) => {
5810
5850
  },
5811
5851
  itemClassname
5812
5852
  );
5813
- return /* @__PURE__ */ React19.createElement("li", { key }, /* @__PURE__ */ React19.createElement(
5853
+ return /* @__PURE__ */ React20.createElement("li", { key }, /* @__PURE__ */ React20.createElement(
5814
5854
  "button",
5815
5855
  __spreadValues({}, __spreadValues({
5816
5856
  onClick: () => {
@@ -5820,7 +5860,7 @@ var Dropdown = (_a) => {
5820
5860
  key,
5821
5861
  className: cn20(itemClass, "w-full")
5822
5862
  }, rest)),
5823
- /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-x-4" }, icon && (iconPosition === "leading" || iconPosition === void 0) && (typeof icon === "string" ? /* @__PURE__ */ React19.createElement(
5863
+ /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-x-4" }, icon && (iconPosition === "leading" || iconPosition === void 0) && (typeof icon === "string" ? /* @__PURE__ */ React20.createElement(
5824
5864
  DynamicIcon,
5825
5865
  __spreadValues({}, {
5826
5866
  icon,
@@ -5831,7 +5871,7 @@ var Dropdown = (_a) => {
5831
5871
  "opacity-60 group"
5832
5872
  )
5833
5873
  })
5834
- ) : /* @__PURE__ */ React19.createElement(
5874
+ ) : /* @__PURE__ */ React20.createElement(
5835
5875
  DynamicIcon,
5836
5876
  __spreadValues({}, __spreadProps(__spreadValues({}, icon), {
5837
5877
  className: cn20(
@@ -5842,7 +5882,7 @@ var Dropdown = (_a) => {
5842
5882
  "opacity-60 group"
5843
5883
  )
5844
5884
  }))
5845
- )), /* @__PURE__ */ React19.createElement("div", { className: "whitespace-nowrap" }, label2), icon && iconPosition === "trailing" && (typeof icon === "string" ? /* @__PURE__ */ React19.createElement(
5885
+ )), /* @__PURE__ */ React20.createElement("div", { className: "whitespace-nowrap" }, label2), icon && iconPosition === "trailing" && (typeof icon === "string" ? /* @__PURE__ */ React20.createElement(
5846
5886
  DynamicIcon,
5847
5887
  __spreadValues({}, {
5848
5888
  icon,
@@ -5853,7 +5893,7 @@ var Dropdown = (_a) => {
5853
5893
  "opacity-60 group"
5854
5894
  )
5855
5895
  })
5856
- ) : /* @__PURE__ */ React19.createElement(
5896
+ ) : /* @__PURE__ */ React20.createElement(
5857
5897
  DynamicIcon,
5858
5898
  __spreadValues({}, __spreadProps(__spreadValues({}, icon), {
5859
5899
  className: cn20(
@@ -5888,7 +5928,7 @@ var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
5888
5928
  button.actionType === "alternative" ? "border-gray-300 bg-white !text-gray-700 fill-gray-700 hover:border-gray-300 hover:bg-gray-50 active:bg-gray-100" : ""
5889
5929
  )
5890
5930
  });
5891
- return /* @__PURE__ */ React20.createElement("div", { className: "flex items-stretch focus-within:ring-purple-600 focus-within:ring-2 focus-within:ring-offset-white focus-within:ring-offset-2 rounded-[3px]" }, /* @__PURE__ */ React20.createElement(
5931
+ return /* @__PURE__ */ React21.createElement("div", { className: "flex items-stretch focus-within:ring-purple-600 focus-within:ring-2 focus-within:ring-offset-white focus-within:ring-offset-2 rounded-[3px]" }, /* @__PURE__ */ React21.createElement(
5892
5932
  Button_default2,
5893
5933
  __spreadValues({}, __spreadProps(__spreadValues({}, button), {
5894
5934
  className: cn21(
@@ -5896,7 +5936,7 @@ var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
5896
5936
  "!rounded-r-none !border-r-0 hover:!border-r-0 !focus:ring-transparent !focus-visible:ring-transparent !focus-within:ring-transparent !focus:ring-0 !focus-within:ring-0 !focus-visible:ring-0 !focus:ring-offset-0 !focus-visible:ring-offset-0 !focus-within:ring-offset-0 !ring-0 outline-none focus:outline-none focus-visible:outline-none focus-within:outline-none !ring-offset-0"
5897
5937
  )
5898
5938
  }))
5899
- ), /* @__PURE__ */ React20.createElement(
5939
+ ), /* @__PURE__ */ React21.createElement(
5900
5940
  "div",
5901
5941
  {
5902
5942
  className: cn21(
@@ -5906,10 +5946,10 @@ var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
5906
5946
  button.actionType === "alternative" ? "bg-gray-300" : ""
5907
5947
  )
5908
5948
  }
5909
- ), /* @__PURE__ */ React20.createElement(
5949
+ ), /* @__PURE__ */ React21.createElement(
5910
5950
  DropdownComponent_default2,
5911
5951
  __spreadValues({}, __spreadProps(__spreadValues({}, dropDown), {
5912
- CustomDropdownTrigger: /* @__PURE__ */ React20.createElement(
5952
+ CustomDropdownTrigger: /* @__PURE__ */ React21.createElement(
5913
5953
  DynamicIcon,
5914
5954
  __spreadValues({}, {
5915
5955
  icon: "ChevronDownIcon",
@@ -5930,7 +5970,7 @@ var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
5930
5970
  },
5931
5971
  placement
5932
5972
  }))
5933
- ), /* @__PURE__ */ React20.createElement("div", { className: "hidden !bg-purple-100 !text-purple-600 transition-all hover:bg-purple-200 focus:bg-purple-300" }));
5973
+ ), /* @__PURE__ */ React21.createElement("div", { className: "hidden !bg-purple-100 !text-purple-600 transition-all hover:bg-purple-200 focus:bg-purple-300" }));
5934
5974
  };
5935
5975
  var ButtonDropdown_default = ButtonDropdown;
5936
5976
 
@@ -5938,7 +5978,7 @@ var ButtonDropdown_default = ButtonDropdown;
5938
5978
  var ButtonDropdown_default2 = ButtonDropdown_default;
5939
5979
 
5940
5980
  // stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx
5941
- import React21 from "react";
5981
+ import React22 from "react";
5942
5982
  import { default as cn22 } from "classnames";
5943
5983
  var EmptySectionPlaceholder = ({
5944
5984
  icon,
@@ -5948,7 +5988,7 @@ var EmptySectionPlaceholder = ({
5948
5988
  actions,
5949
5989
  isWide
5950
5990
  }) => {
5951
- return /* @__PURE__ */ React21.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center border-2 border-dashed border-gray-300 p-5" }, /* @__PURE__ */ React21.createElement(IconWithShadow_default, __spreadValues({}, icon)), mutedText && /* @__PURE__ */ React21.createElement("p", { className: "my-2 block text-xs text-gray-500" }, mutedText), CallToActionComponent ? CallToActionComponent : /* @__PURE__ */ React21.createElement("p", { className: "mb-2 block text-sm font-medium text-gray-600" }, primaryMessage), actions.length > 0 ? /* @__PURE__ */ React21.createElement("div", { className: cn22("mt-2 flex gap-2", isWide ? "" : "flex-col items-center") }, actions.map((action, index) => /* @__PURE__ */ React21.createElement(Button_default2, __spreadProps(__spreadValues({}, __spreadValues({}, action)), { key: action.label.replaceAll(" ", "-") })))) : /* @__PURE__ */ React21.createElement(React21.Fragment, null));
5991
+ return /* @__PURE__ */ React22.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center border-2 border-dashed border-gray-300 p-5" }, /* @__PURE__ */ React22.createElement(IconWithShadow_default, __spreadValues({}, icon)), mutedText && /* @__PURE__ */ React22.createElement("p", { className: "my-2 block text-xs text-gray-500" }, mutedText), CallToActionComponent ? CallToActionComponent : /* @__PURE__ */ React22.createElement("p", { className: "mb-2 block text-sm font-medium text-gray-600" }, primaryMessage), actions.length > 0 ? /* @__PURE__ */ React22.createElement("div", { className: cn22("mt-2 flex gap-2", isWide ? "" : "flex-col items-center") }, actions.map((action, index) => /* @__PURE__ */ React22.createElement(Button_default2, __spreadProps(__spreadValues({}, __spreadValues({}, action)), { key: action.label.replaceAll(" ", "-") })))) : /* @__PURE__ */ React22.createElement(React22.Fragment, null));
5952
5992
  };
5953
5993
  var EmptySectionPlaceholder_default = EmptySectionPlaceholder;
5954
5994
 
@@ -5956,7 +5996,7 @@ var EmptySectionPlaceholder_default = EmptySectionPlaceholder;
5956
5996
  var EmptySectionPlaceholder_default2 = EmptySectionPlaceholder_default;
5957
5997
 
5958
5998
  // stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx
5959
- import React22, { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState7 } from "react";
5999
+ import React23, { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState8 } from "react";
5960
6000
  import { default as cn23 } from "classnames";
5961
6001
  var FormInputWithAddons = (_a) => {
5962
6002
  var _b = _a, {
@@ -6008,14 +6048,14 @@ var FormInputWithAddons = (_a) => {
6008
6048
  ]);
6009
6049
  const leadLabelRef = useRef2(null);
6010
6050
  const trailLabelRef = useRef2(null);
6011
- const [leadLabelWidth, setLeadLabelWidth] = useState7(0);
6012
- const [trailLabelWidth, setTrailLabelWidth] = useState7(0);
6051
+ const [leadLabelWidth, setLeadLabelWidth] = useState8(0);
6052
+ const [trailLabelWidth, setTrailLabelWidth] = useState8(0);
6013
6053
  useLayoutEffect2(() => {
6014
6054
  var _a2, _b2;
6015
6055
  setLeadLabelWidth(((_a2 = leadLabelRef.current) == null ? void 0 : _a2.clientWidth) || 0);
6016
6056
  setTrailLabelWidth(((_b2 = trailLabelRef.current) == null ? void 0 : _b2.clientWidth) || 0);
6017
6057
  }, []);
6018
- return /* @__PURE__ */ React22.createElement("div", { className: cn23("group flex flex-col", containerClassName) }, !leadLabel && !trailLabel && topLabel && /* @__PURE__ */ React22.createElement("label", { htmlFor: id2, className: cn23("flex items-center text-sm font-medium text-gray-600", labelClass) }, topLabel), description && /* @__PURE__ */ React22.createElement("div", { className: "mb-2 text-sm text-gray-500" }, description), /* @__PURE__ */ React22.createElement("div", { className: "relative flex-grow" }, (leadLabel || leadIcon) && /* @__PURE__ */ React22.createElement(
6058
+ return /* @__PURE__ */ React23.createElement("div", { className: cn23("group flex flex-col", containerClassName) }, !leadLabel && !trailLabel && topLabel && /* @__PURE__ */ React23.createElement("label", { htmlFor: id2, className: cn23("flex items-center text-sm font-medium text-gray-600", labelClass) }, topLabel), description && /* @__PURE__ */ React23.createElement("div", { className: "mb-2 text-sm text-gray-500" }, description), /* @__PURE__ */ React23.createElement("div", { className: "relative flex-grow" }, (leadLabel || leadIcon) && /* @__PURE__ */ React23.createElement(
6019
6059
  "label",
6020
6060
  {
6021
6061
  ref: leadLabelRef,
@@ -6025,7 +6065,7 @@ var FormInputWithAddons = (_a) => {
6025
6065
  labelClass
6026
6066
  )
6027
6067
  },
6028
- leadIcon && /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(
6068
+ leadIcon && /* @__PURE__ */ React23.createElement("span", null, /* @__PURE__ */ React23.createElement(
6029
6069
  DynamicIcon,
6030
6070
  __spreadValues({}, __spreadProps(__spreadValues({}, leadIcon), {
6031
6071
  className: cn23("h-5 w-5 text-gray-400", leadIconClassNames, customIconClass),
@@ -6033,7 +6073,7 @@ var FormInputWithAddons = (_a) => {
6033
6073
  }))
6034
6074
  )),
6035
6075
  leadLabel && leadLabel
6036
- ), /* @__PURE__ */ React22.createElement(
6076
+ ), /* @__PURE__ */ React23.createElement(
6037
6077
  InputField_default2,
6038
6078
  __spreadValues({}, __spreadProps(__spreadValues({}, rest), {
6039
6079
  handleChange,
@@ -6053,7 +6093,7 @@ var FormInputWithAddons = (_a) => {
6053
6093
  paddingLeft: `${leadLabelWidth + addonOffset}px`
6054
6094
  }
6055
6095
  }))
6056
- ), (trailLabel || trailIcon) && /* @__PURE__ */ React22.createElement(
6096
+ ), (trailLabel || trailIcon) && /* @__PURE__ */ React23.createElement(
6057
6097
  "label",
6058
6098
  {
6059
6099
  ref: trailLabelRef,
@@ -6063,7 +6103,7 @@ var FormInputWithAddons = (_a) => {
6063
6103
  labelClass
6064
6104
  )
6065
6105
  },
6066
- trailIcon && /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(
6106
+ trailIcon && /* @__PURE__ */ React23.createElement("span", null, /* @__PURE__ */ React23.createElement(
6067
6107
  DynamicIcon,
6068
6108
  __spreadValues({}, __spreadProps(__spreadValues({}, trailIcon), {
6069
6109
  className: cn23("h-5 w-5 text-gray-400", customIconClass),
@@ -6077,6 +6117,152 @@ var FormInputWithAddons_default = FormInputWithAddons;
6077
6117
 
6078
6118
  // stories/organisms/FormInputWithAddons/index.tsx
6079
6119
  var FormInputWithAddons_default2 = FormInputWithAddons_default;
6120
+
6121
+ // stories/organisms/TextInputSelect/TextInputSelect.tsx
6122
+ import React25, { useEffect as useEffect6, useId as useId4, useRef as useRef3, useState as useState10 } from "react";
6123
+ import { default as cn25 } from "classnames";
6124
+
6125
+ // stories/organisms/TextInputSelect/InputSelect.tsx
6126
+ import React24, { useState as useState9 } from "react";
6127
+ import { default as cn24 } from "classnames";
6128
+ var InputSelect = ({
6129
+ inputOptions,
6130
+ onSelectOption,
6131
+ align = "right",
6132
+ className,
6133
+ isDisabled
6134
+ }) => {
6135
+ const [selectedOption, setSelectedOption] = useState9(inputOptions[0].value);
6136
+ const handleChange = (e) => {
6137
+ const targetValue = e.target.value;
6138
+ onSelectOption && onSelectOption(targetValue);
6139
+ setSelectedOption(targetValue);
6140
+ };
6141
+ if (!(inputOptions == null ? void 0 : inputOptions.length))
6142
+ return null;
6143
+ return /* @__PURE__ */ React24.createElement(
6144
+ "select",
6145
+ {
6146
+ className: cn24(
6147
+ "relative z-10 inline-flex items-center space-x-2 border border-gray-300 bg-white px-4 py-2 pr-7 text-sm font-medium",
6148
+ "focus:border-purple-500 focus:outline-none focus:ring-1 focus:ring-purple-500",
6149
+ align === "right" ? "-ml-px rounded-r border-l-white text-gray-700" : align === "left" ? "-mr-px rounded-l border-r-white text-gray-500 focus-within:z-10" : "",
6150
+ !onSelectOption ? "cursor-default" : "",
6151
+ className
6152
+ ),
6153
+ onChange: handleChange,
6154
+ value: selectedOption,
6155
+ disabled: isDisabled
6156
+ },
6157
+ inputOptions.map((option) => /* @__PURE__ */ React24.createElement("option", { key: option.value, value: option.value }, option.label))
6158
+ );
6159
+ };
6160
+
6161
+ // stories/organisms/TextInputSelect/TextInputSelect.tsx
6162
+ var TextInputSelect = ({
6163
+ label,
6164
+ isFocused,
6165
+ isError,
6166
+ id: id2,
6167
+ name,
6168
+ isRequired,
6169
+ type,
6170
+ defaultValue,
6171
+ isDisabled,
6172
+ message,
6173
+ isShowCounter,
6174
+ maxLength,
6175
+ placeholder,
6176
+ inputOptions,
6177
+ selectLocation = "right",
6178
+ prefix,
6179
+ onChange,
6180
+ onSelectOption,
6181
+ value: externalValue
6182
+ }) => {
6183
+ const [isFocus, setIsFocus] = useState10(Boolean(isFocused));
6184
+ const [value, setValue] = useState10(defaultValue || "");
6185
+ const inputRef = useRef3(null);
6186
+ const uniqueID = useId4();
6187
+ if (!id2)
6188
+ id2 = `select-${uniqueID}`;
6189
+ if (!name)
6190
+ name = id2;
6191
+ useEffect6(() => {
6192
+ setValue(externalValue);
6193
+ }, [externalValue]);
6194
+ useEffect6(() => {
6195
+ const input = inputRef.current;
6196
+ if (!input || isFocus === void 0 || isFocused === void 0 || isDisabled)
6197
+ return;
6198
+ if (isFocus || isFocused) {
6199
+ input.focus();
6200
+ } else {
6201
+ input.blur();
6202
+ }
6203
+ }, [isFocus, isFocused]);
6204
+ useEffect6(() => {
6205
+ const input = inputRef.current;
6206
+ if (!input || defaultValue === void 0 || defaultValue === "")
6207
+ return;
6208
+ }, [defaultValue]);
6209
+ const handleInputFocus = () => {
6210
+ setIsFocus(true);
6211
+ };
6212
+ const handleInputBlur = () => {
6213
+ setIsFocus(false);
6214
+ };
6215
+ const labelStyles = cn25("block inline-block font-medium transition-all text-sm text-gray-700 mb-1", {
6216
+ "text-red-500 bg-white": isError
6217
+ });
6218
+ const discriptionStyles = cn25("text-sm mt-1 block", { "text-gray-500": !isError }, { "text-red-500": isError });
6219
+ return /* @__PURE__ */ React25.createElement("div", null, label && /* @__PURE__ */ React25.createElement("label", { htmlFor: id2, className: labelStyles }, label, isRequired && /* @__PURE__ */ React25.createElement("span", { className: "text-red-500" }, " *")), /* @__PURE__ */ React25.createElement("div", { className: "flex" }, (inputOptions == null ? void 0 : inputOptions.length) && selectLocation === "left" && /* @__PURE__ */ React25.createElement(
6220
+ InputSelect,
6221
+ {
6222
+ inputOptions,
6223
+ align: "left",
6224
+ onSelectOption,
6225
+ className: cn25(isError ? "border-red-500" : ""),
6226
+ isDisabled
6227
+ }
6228
+ ), /* @__PURE__ */ React25.createElement("div", { className: "relative flex-grow focus-within:z-20" }, prefix && /* @__PURE__ */ React25.createElement("div", { className: "pointer-events-none pr-10 absolute inset-y-0 left-0 flex items-center pl-3" }, /* @__PURE__ */ React25.createElement("span", { className: "text-gray-500 sm:text-sm" }, prefix)), /* @__PURE__ */ React25.createElement(
6229
+ InputField_default2,
6230
+ {
6231
+ onFocus: handleInputFocus,
6232
+ onBlur: handleInputBlur,
6233
+ handleChange: (v) => onChange && onChange(v),
6234
+ ref: inputRef,
6235
+ type,
6236
+ name,
6237
+ id: id2,
6238
+ className: cn25(
6239
+ "w-full border border-gray-300 py-2 px-3 text-sm font-normal leading-5",
6240
+ "focus:border-purple-500 focus:outline-none focus:ring-1 focus:ring-purple-500 sm:text-sm",
6241
+ selectLocation === "right" ? `rounded-l` : `rounded-r`,
6242
+ isError ? "border-red-500" : "",
6243
+ prefix ? `pl-7` : ""
6244
+ ),
6245
+ isDisabled,
6246
+ defaultValue,
6247
+ value,
6248
+ maxLength,
6249
+ placeholder
6250
+ }
6251
+ )), (inputOptions == null ? void 0 : inputOptions.length) && selectLocation === "right" && /* @__PURE__ */ React25.createElement(
6252
+ InputSelect,
6253
+ {
6254
+ inputOptions,
6255
+ align: "right",
6256
+ onSelectOption,
6257
+ isDisabled,
6258
+ className: cn25(isError ? "border-red-500" : "")
6259
+ }
6260
+ )), /* @__PURE__ */ React25.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React25.createElement("div", { className: "grow" }, message && /* @__PURE__ */ React25.createElement("span", { className: discriptionStyles }, message)), isShowCounter && /* @__PURE__ */ React25.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React25.createElement(InputCounter_default, { current: Number(value == null ? void 0 : value.length), limit: maxLength }))));
6261
+ };
6262
+ var TextInputSelect_default = TextInputSelect;
6263
+
6264
+ // stories/organisms/TextInputSelect/index.tsx
6265
+ var TextInputSelect_default2 = TextInputSelect_default;
6080
6266
  export {
6081
6267
  AnimatedLabelInput_default2 as AnimatedLabelInput,
6082
6268
  Avatar_default2 as Avatar,
@@ -6098,8 +6284,9 @@ export {
6098
6284
  NProgress_default as RadialProgress,
6099
6285
  radio_default as Radio,
6100
6286
  select_default as Select,
6101
- textArea_default as TextAreaField,
6102
6287
  TextInput_default2 as TextInput,
6288
+ TextInputSelect_default2 as TextInputSelect,
6289
+ textArea_default as Textarea,
6103
6290
  toggleSwitch_default as ToggleSwitch,
6104
6291
  isFAIcon,
6105
6292
  isHeroIcon,