@agility/plenum-ui 2.0.0-rc1 → 2.0.0-rc10

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 (58) hide show
  1. package/README.md +1 -1
  2. package/build.js +8 -0
  3. package/dist/index.d.ts +1117 -0
  4. package/dist/index.js +515 -155
  5. package/dist/index.js.map +4 -4
  6. package/dist/lib/tailwind.css +63535 -0
  7. package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +1 -0
  8. package/dist/types/stories/atoms/buttons/Button/Button.d.ts +6 -4
  9. package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +1 -0
  10. package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +1 -0
  11. package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +1 -0
  12. package/dist/types/stories/index.d.ts +4 -4
  13. package/dist/types/stories/molecules/index.d.ts +3 -3
  14. package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
  15. package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
  16. package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +3 -1
  17. package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
  18. package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
  19. package/dist/types/stories/molecules/inputs/index.d.ts +5 -4
  20. package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -2
  21. package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +30 -21
  22. package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
  23. package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
  24. package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +2 -2
  25. package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +3 -7
  26. package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
  27. package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
  28. package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
  29. package/dist/types/stories/organisms/index.d.ts +3 -2
  30. package/package.json +4 -3
  31. package/stories/Introduction.mdx +1 -1
  32. package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +7 -0
  33. package/stories/atoms/buttons/Button/Button.tsx +25 -2
  34. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +7 -0
  35. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +7 -0
  36. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +7 -0
  37. package/stories/index.ts +18 -8
  38. package/stories/molecules/index.ts +22 -6
  39. package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -0
  40. package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -0
  41. package/stories/molecules/inputs/InputCounter/index.tsx +3 -0
  42. package/stories/molecules/inputs/InputField/InputField.tsx +7 -1
  43. package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -0
  44. package/stories/molecules/inputs/TextInput/TextInput.tsx +162 -0
  45. package/stories/molecules/inputs/TextInput/index.tsx +5 -0
  46. package/stories/molecules/inputs/index.ts +18 -4
  47. package/stories/molecules/inputs/select/Select.tsx +1 -1
  48. package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
  49. package/stories/molecules/inputs/textArea/TextArea.tsx +110 -49
  50. package/stories/molecules/inputs/textArea/index.ts +3 -3
  51. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +3 -3
  52. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +111 -80
  53. package/stories/organisms/DropdownComponent/dropdownItems.ts +8 -8
  54. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
  55. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
  56. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
  57. package/stories/organisms/TextInputSelect/index.tsx +3 -0
  58. package/stories/organisms/index.ts +4 -2
package/dist/index.js CHANGED
@@ -4643,23 +4643,27 @@ var Button = (_a) => {
4643
4643
  size = "sm",
4644
4644
  label,
4645
4645
  icon,
4646
+ iconObj,
4646
4647
  CustomSVGIcon,
4647
4648
  fullWidth = false,
4648
4649
  iconPosition = "trailing",
4649
4650
  asLink,
4650
4651
  isLoading = false,
4651
- className
4652
+ className,
4653
+ ref
4652
4654
  } = _b, props = __objRest(_b, [
4653
4655
  "actionType",
4654
4656
  "size",
4655
4657
  "label",
4656
4658
  "icon",
4659
+ "iconObj",
4657
4660
  "CustomSVGIcon",
4658
4661
  "fullWidth",
4659
4662
  "iconPosition",
4660
4663
  "asLink",
4661
4664
  "isLoading",
4662
- "className"
4665
+ "className",
4666
+ "ref"
4663
4667
  ]);
4664
4668
  const iconStyles = cn5(
4665
4669
  { "text-white h-5 w-5": actionType === "primary" || actionType === "danger" },
@@ -4698,13 +4702,16 @@ var Button = (_a) => {
4698
4702
  " bg-red-600 text-white hover:bg-red-700 <focus-visible:!></focus-visible:!>ring-red-500 focus:!ring-red-500 active:!ring-red-500 focus-within:!ring-red-500 ": actionType === "danger"
4699
4703
  },
4700
4704
  className ? className : ""
4701
- )
4705
+ ),
4706
+ ref
4702
4707
  }, props),
4703
4708
  CustomSVGIcon && (isLoading ? /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }) : /* @__PURE__ */ React.createElement("i", null, CustomSVGIcon)),
4704
- icon && iconPosition === "leading" && (isLoading ? /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }) : /* @__PURE__ */ React.createElement(DynamicIcon, __spreadValues({}, __spreadProps(__spreadValues({}, icon), { className: iconStyles })))),
4709
+ iconObj && iconPosition === "leading" && (!isLoading ? /* @__PURE__ */ React.createElement(React.Fragment, null, iconObj) : /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) })),
4710
+ icon && iconPosition === "leading" && (isLoading ? /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }) : typeof icon === "string" ? /* @__PURE__ */ React.createElement(DynamicIcon, __spreadValues({}, { icon, className: iconStyles })) : /* @__PURE__ */ React.createElement(DynamicIcon, __spreadValues({}, __spreadProps(__spreadValues({}, icon), { className: iconStyles })))),
4705
4711
  !icon && !CustomSVGIcon && isLoading && /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }),
4706
4712
  label,
4707
- icon && iconPosition === "trailing" && (isLoading ? /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }) : /* @__PURE__ */ React.createElement(DynamicIcon, __spreadValues({}, __spreadProps(__spreadValues({}, icon), { className: iconStyles }))))
4713
+ icon && iconPosition === "trailing" && (isLoading ? /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }) : typeof icon === "string" ? /* @__PURE__ */ React.createElement(DynamicIcon, __spreadValues({}, { icon, className: iconStyles })) : /* @__PURE__ */ React.createElement(DynamicIcon, __spreadValues({}, __spreadProps(__spreadValues({}, icon), { className: iconStyles })))),
4714
+ iconObj && iconPosition === "trailing" && (!isLoading ? /* @__PURE__ */ React.createElement(React.Fragment, null, iconObj) : /* @__PURE__ */ React.createElement("div", { className: cn5("h-4 rounded-full w-4 border-2 m-0 animate-spin", loaderColors, loaderSize) }))
4708
4715
  );
4709
4716
  };
4710
4717
  var Button_default = Button;
@@ -5135,7 +5142,8 @@ var InputField = (_a) => {
5135
5142
  required,
5136
5143
  clientSideCheck = true,
5137
5144
  placeholder,
5138
- className
5145
+ className,
5146
+ ref
5139
5147
  } = _b, rest = __objRest(_b, [
5140
5148
  "type",
5141
5149
  "id",
@@ -5149,16 +5157,19 @@ var InputField = (_a) => {
5149
5157
  "required",
5150
5158
  "clientSideCheck",
5151
5159
  "placeholder",
5152
- "className"
5160
+ "className",
5161
+ "ref"
5153
5162
  ]);
5154
5163
  return /* @__PURE__ */ React11.createElement(
5155
5164
  "input",
5156
5165
  __spreadValues({}, __spreadValues({
5157
5166
  type,
5158
5167
  id: id2,
5168
+ ref,
5159
5169
  name,
5160
5170
  value,
5161
5171
  onChange: (e) => {
5172
+ console.log(e);
5162
5173
  handleChange(e.target.value);
5163
5174
  },
5164
5175
  autoFocus: isFocused,
@@ -5360,65 +5371,232 @@ var Select_default = Select;
5360
5371
  var select_default = Select_default;
5361
5372
 
5362
5373
  // stories/molecules/inputs/textArea/TextArea.tsx
5374
+ import React16, { useEffect as useEffect3, useId as useId2, useState as useState4 } from "react";
5363
5375
  import { default as cn16 } from "classnames";
5364
- 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) => {
5365
5386
  var _b = _a, {
5366
5387
  id: id2,
5367
5388
  name,
5368
- value,
5369
- isFocused,
5389
+ label,
5370
5390
  isError,
5371
- isReadonly,
5391
+ isRequired,
5372
5392
  isDisabled,
5373
- handleChange,
5374
- required,
5393
+ defaultValue,
5394
+ message,
5395
+ isShowCounter,
5396
+ maxLength,
5397
+ rows = 12,
5398
+ cols = 48,
5399
+ onChange,
5400
+ value: externalValue,
5375
5401
  placeholder,
5376
- className
5402
+ className,
5403
+ ref
5377
5404
  } = _b, rest = __objRest(_b, [
5378
5405
  "id",
5379
5406
  "name",
5380
- "value",
5381
- "isFocused",
5407
+ "label",
5382
5408
  "isError",
5383
- "isReadonly",
5409
+ "isRequired",
5384
5410
  "isDisabled",
5385
- "handleChange",
5386
- "required",
5411
+ "defaultValue",
5412
+ "message",
5413
+ "isShowCounter",
5414
+ "maxLength",
5415
+ "rows",
5416
+ "cols",
5417
+ "onChange",
5418
+ "value",
5387
5419
  "placeholder",
5388
- "className"
5420
+ "className",
5421
+ "ref"
5389
5422
  ]);
5390
- return /* @__PURE__ */ React.createElement(
5391
- "textarea",
5392
- __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,
5393
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,
5394
5456
  name,
5395
- value,
5396
- onChange: (e) => {
5397
- handleChange(e.target.value);
5398
- },
5399
- autoFocus: isFocused,
5400
- readOnly: isReadonly,
5401
- disabled: isDisabled,
5402
- required,
5403
- placeholder: placeholder || " ",
5404
- "aria-invalid": isError,
5405
- "aria-disabled": isDisabled,
5457
+ id: id2,
5458
+ cols,
5406
5459
  className: cn16(
5407
- "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",
5408
- 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
+ },
5409
5465
  className
5410
- )
5411
- }, rest))
5412
- );
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 }))));
5413
5473
  };
5414
- var TextArea_default = TextAreaField;
5474
+ var TextArea_default = Textarea;
5415
5475
 
5416
5476
  // stories/molecules/inputs/textArea/index.ts
5417
5477
  var textArea_default = TextArea_default;
5418
5478
 
5419
- // stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx
5420
- import React15, { useEffect as useEffect3, useState as useState4 } from "react";
5479
+ // stories/molecules/inputs/TextInput/TextInput.tsx
5480
+ import React17, { forwardRef as forwardRef2, useEffect as useEffect4, useId as useId3, useRef, useState as useState5 } from "react";
5421
5481
  import { default as cn17 } from "classnames";
5482
+ var TextInput = (_a, ref) => {
5483
+ var _b = _a, {
5484
+ label,
5485
+ isFocused,
5486
+ isError,
5487
+ id: id2,
5488
+ name,
5489
+ isRequired,
5490
+ type,
5491
+ defaultValue,
5492
+ isDisabled,
5493
+ isReadonly,
5494
+ message,
5495
+ isShowCounter,
5496
+ maxLength,
5497
+ onChange,
5498
+ placeholder,
5499
+ value: externalValue,
5500
+ className
5501
+ } = _b, props = __objRest(_b, [
5502
+ "label",
5503
+ "isFocused",
5504
+ "isError",
5505
+ "id",
5506
+ "name",
5507
+ "isRequired",
5508
+ "type",
5509
+ "defaultValue",
5510
+ "isDisabled",
5511
+ "isReadonly",
5512
+ "message",
5513
+ "isShowCounter",
5514
+ "maxLength",
5515
+ "onChange",
5516
+ "placeholder",
5517
+ "value",
5518
+ "className"
5519
+ ]);
5520
+ const uniqueID = useId3();
5521
+ const [isFocus, setIsFocus] = useState5(Boolean(isFocused));
5522
+ const [value, setValue] = useState5(externalValue || defaultValue || "");
5523
+ const inputRef = useRef(null);
5524
+ useEffect4(() => {
5525
+ if (externalValue !== void 0 && externalValue !== null) {
5526
+ setValue(externalValue);
5527
+ }
5528
+ }, [externalValue]);
5529
+ useEffect4(() => {
5530
+ const input = inputRef.current;
5531
+ if (!input || isFocus === void 0 || isDisabled)
5532
+ return;
5533
+ if (isFocus) {
5534
+ input.focus();
5535
+ } else {
5536
+ input.blur();
5537
+ }
5538
+ }, [isFocus]);
5539
+ useEffect4(() => {
5540
+ const input = inputRef.current;
5541
+ if (!input || defaultValue === void 0 || defaultValue === "")
5542
+ return;
5543
+ }, [defaultValue]);
5544
+ const handleInputFocus = () => setIsFocus(true);
5545
+ const handleInputBlur = () => setIsFocus(false);
5546
+ if (!id2)
5547
+ id2 = `input-${uniqueID}`;
5548
+ if (!name)
5549
+ name = id2;
5550
+ return /* @__PURE__ */ React17.createElement("div", { className: "relative" }, /* @__PURE__ */ React17.createElement(
5551
+ InputLabel_default2,
5552
+ {
5553
+ isPlaceholder: true,
5554
+ label,
5555
+ isRequired,
5556
+ id: id2,
5557
+ isError,
5558
+ isActive: true,
5559
+ isDisabled
5560
+ }
5561
+ ), /* @__PURE__ */ React17.createElement(
5562
+ InputField_default2,
5563
+ __spreadValues({
5564
+ onFocus: handleInputFocus,
5565
+ onBlur: handleInputBlur,
5566
+ handleChange: (v) => setValue(v),
5567
+ ref,
5568
+ type,
5569
+ name,
5570
+ id: id2,
5571
+ className: cn17(
5572
+ "w-full rounded border py-2 px-3 text-sm font-normal leading-5",
5573
+ { "border-gray-300": !isFocus && !isError },
5574
+ {
5575
+ "!border-purple-500 shadow-none outline-purple-500 focus:!ring-purple-500": isFocus && !isError
5576
+ },
5577
+ {
5578
+ "!border-red-500 shadow-none focus:ring-red-500": isError
5579
+ },
5580
+ className
5581
+ ),
5582
+ isDisabled,
5583
+ isReadonly,
5584
+ value,
5585
+ defaultValue,
5586
+ maxLength,
5587
+ placeholder
5588
+ }, props)
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 }))));
5590
+ };
5591
+ var _TextInput = forwardRef2(TextInput);
5592
+ var TextInput_default = _TextInput;
5593
+
5594
+ // stories/molecules/inputs/TextInput/index.tsx
5595
+ var TextInput_default2 = TextInput_default;
5596
+
5597
+ // stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx
5598
+ import React18, { useEffect as useEffect5, useState as useState6 } from "react";
5599
+ import { default as cn18 } from "classnames";
5422
5600
  import { Switch } from "@headlessui/react";
5423
5601
  var ToggleSwitch = ({
5424
5602
  isChecked,
@@ -5430,9 +5608,9 @@ var ToggleSwitch = ({
5430
5608
  variant = "base",
5431
5609
  withIcon
5432
5610
  }) => {
5433
- const [checked, setChecked] = useState4(isChecked);
5434
- useEffect3(() => setChecked(isChecked), [isChecked]);
5435
- return /* @__PURE__ */ React15.createElement(Switch.Group, { as: "div", className: "flex items-center gap-2" }, label && label.xPosition === "left" && /* @__PURE__ */ React15.createElement(Switch.Label, { className: label.className }, label.text), /* @__PURE__ */ React15.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(
5436
5614
  Switch,
5437
5615
  {
5438
5616
  name,
@@ -5442,17 +5620,17 @@ var ToggleSwitch = ({
5442
5620
  onChange(v);
5443
5621
  setChecked(v);
5444
5622
  },
5445
- className: cn17(
5623
+ className: cn18(
5446
5624
  { "w-9 h-4": variant === "short", " h-6 w-11": variant === "base" },
5447
5625
  checked ? "bg-purple-600" : "bg-gray-200",
5448
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"
5449
5627
  )
5450
5628
  },
5451
- /* @__PURE__ */ React15.createElement("span", { className: "sr-only" }, screenReaderLabel),
5452
- /* @__PURE__ */ React15.createElement(
5629
+ /* @__PURE__ */ React18.createElement("span", { className: "sr-only" }, screenReaderLabel),
5630
+ /* @__PURE__ */ React18.createElement(
5453
5631
  "span",
5454
5632
  {
5455
- className: cn17(
5633
+ className: cn18(
5456
5634
  checked ? "translate-x-[22px]" : "translate-x-[2px]",
5457
5635
  {
5458
5636
  "border border-gray-200 translate-x-0": variant === "short",
@@ -5461,9 +5639,9 @@ var ToggleSwitch = ({
5461
5639
  " h-5 w-5 transform rounded-full bg-white transition shadow-sm drop-shadow flex items-center justify-center"
5462
5640
  )
5463
5641
  },
5464
- withIcon && /* @__PURE__ */ React15.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]" }))
5465
5643
  )
5466
- ), label && label.xPosition === "right" && /* @__PURE__ */ React15.createElement(Switch.Label, { className: label.className }, label.text));
5644
+ ), label && label.xPosition === "right" && /* @__PURE__ */ React18.createElement(Switch.Label, { className: label.className }, label.text));
5467
5645
  };
5468
5646
  var ToggleSwitch_default = ToggleSwitch;
5469
5647
 
@@ -5471,8 +5649,8 @@ var ToggleSwitch_default = ToggleSwitch;
5471
5649
  var toggleSwitch_default = ToggleSwitch_default;
5472
5650
 
5473
5651
  // stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx
5474
- import React16 from "react";
5475
- import { default as cn18 } from "classnames";
5652
+ import React19 from "react";
5653
+ import { default as cn19 } from "classnames";
5476
5654
  var AnimatedLabelInput = ({
5477
5655
  id: id2,
5478
5656
  label,
@@ -5483,10 +5661,10 @@ var AnimatedLabelInput = ({
5483
5661
  isError,
5484
5662
  containerStyles
5485
5663
  }) => {
5486
- return /* @__PURE__ */ React16.createElement("div", { className: cn18("group relative", containerStyles ? containerStyles : "") }, input && /* @__PURE__ */ React16.createElement(InputField_default2, __spreadValues({ isError }, input)), textarea && /* @__PURE__ */ React16.createElement(TextArea_default, __spreadValues({ isError }, textarea)), /* @__PURE__ */ React16.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(
5487
5665
  "label",
5488
5666
  {
5489
- className: cn18(
5667
+ className: cn19(
5490
5668
  "absolute left-1 z-10 ml-[.172rem] inline-block bg-white px-1 text-xs transition-all peer-placeholder-shown:top-2 peer-placeholder-shown:text-sm peer-placeholder-shown:text-gray-600",
5491
5669
  "-top-[9px] group-focus-within:!-top-[12px] group-focus-within:!left-1 group-focus-within:!ml-[.172rem] group-focus-within:!text-xs",
5492
5670
  isError && "!text-red-600"
@@ -5494,8 +5672,8 @@ var AnimatedLabelInput = ({
5494
5672
  htmlFor: id2
5495
5673
  },
5496
5674
  label.display,
5497
- required && /* @__PURE__ */ React16.createElement("span", { className: "text-red-600" }, "*")
5498
- ), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React16.createElement("div", { className: "grow transition-all" }, message && /* @__PURE__ */ React16.createElement("span", { className: cn18("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))));
5499
5677
  };
5500
5678
  var AnimatedLabelInput_default = AnimatedLabelInput;
5501
5679
 
@@ -5503,13 +5681,13 @@ var AnimatedLabelInput_default = AnimatedLabelInput;
5503
5681
  var AnimatedLabelInput_default2 = AnimatedLabelInput_default;
5504
5682
 
5505
5683
  // stories/organisms/ButtonDropdown/ButtonDropdown.tsx
5506
- import React18 from "react";
5507
- import { default as cn20 } from "classnames";
5684
+ import React21 from "react";
5685
+ import { default as cn21 } from "classnames";
5508
5686
 
5509
5687
  // stories/organisms/DropdownComponent/DropdownComponent.tsx
5510
- import React17, { Fragment, useState as useState5 } from "react";
5688
+ import React20, { Fragment, useState as useState7 } from "react";
5511
5689
  import { Transition } from "@headlessui/react";
5512
- import { default as cn19 } from "classnames";
5690
+ import { default as cn20 } from "classnames";
5513
5691
  import {
5514
5692
  useFloating,
5515
5693
  autoUpdate,
@@ -5550,8 +5728,8 @@ var Dropdown = (_a) => {
5550
5728
  "offsetOptions"
5551
5729
  ]);
5552
5730
  var _a2, _b2;
5553
- const [isOpen, setIsOpen] = useState5(false);
5554
- const [activeItem, setActiveItem] = useState5(null);
5731
+ const [isOpen, setIsOpen] = useState7(false);
5732
+ const [activeItem, setActiveItem] = useState7(null);
5555
5733
  const { refs, floatingStyles, context } = useFloating({
5556
5734
  open: isOpen,
5557
5735
  onOpenChange: setIsOpen,
@@ -5582,7 +5760,7 @@ var Dropdown = (_a) => {
5582
5760
  }
5583
5761
  });
5584
5762
  const { groupClassname, buttonClassname, itemsClassname, itemClassname, activeItemClassname } = classNames3;
5585
- return /* @__PURE__ */ React17.createElement(
5763
+ return /* @__PURE__ */ React20.createElement(
5586
5764
  "div",
5587
5765
  __spreadValues({}, __spreadValues({
5588
5766
  className: groupClassname,
@@ -5591,7 +5769,7 @@ var Dropdown = (_a) => {
5591
5769
  "aria-expanded": isOpen,
5592
5770
  "aria-haspopup": "listbox"
5593
5771
  }, props)),
5594
- /* @__PURE__ */ React17.createElement(
5772
+ /* @__PURE__ */ React20.createElement(
5595
5773
  "button",
5596
5774
  __spreadValues({}, __spreadValues({
5597
5775
  ref: refs.setReference,
@@ -5600,9 +5778,9 @@ var Dropdown = (_a) => {
5600
5778
  setIsOpen(!isOpen);
5601
5779
  }
5602
5780
  }, getReferenceProps())),
5603
- CustomDropdownTrigger ? /* @__PURE__ */ React17.createElement("span", { className: "" }, CustomDropdownTrigger) : /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("span", { className: "pl-1" }, label), /* @__PURE__ */ React17.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 " }))
5604
5782
  ),
5605
- isMounted && items.length > 0 && isOpen && /* @__PURE__ */ React17.createElement(FloatingPortal, null, /* @__PURE__ */ React17.createElement(FloatingFocusManager, { context, modal: true }, /* @__PURE__ */ React17.createElement(
5783
+ isMounted && items.length > 0 && isOpen && /* @__PURE__ */ React20.createElement(FloatingPortal, null, /* @__PURE__ */ React20.createElement(FloatingFocusManager, { context, modal: true }, /* @__PURE__ */ React20.createElement(
5606
5784
  Transition,
5607
5785
  {
5608
5786
  as: Fragment,
@@ -5614,7 +5792,7 @@ var Dropdown = (_a) => {
5614
5792
  leaveFrom: "transform opacity-100 scale-100",
5615
5793
  leaveTo: "transform opacity-0 scale-95"
5616
5794
  },
5617
- /* @__PURE__ */ React17.createElement(
5795
+ /* @__PURE__ */ React20.createElement(
5618
5796
  "ul",
5619
5797
  __spreadValues(__spreadProps(__spreadValues({}, __spreadProps(__spreadValues({}, getFloatingProps()), {
5620
5798
  className: itemsClassname,
@@ -5636,66 +5814,100 @@ var Dropdown = (_a) => {
5636
5814
  "aria-labelledby": label
5637
5815
  }), getFloatingProps()),
5638
5816
  items.map((itemStack, idx) => {
5639
- return /* @__PURE__ */ React17.createElement(React17.Fragment, { key: `${idx}-list-${id2}` }, itemStack.map((_a3) => {
5640
- var _b3 = _a3, { onClick, label: label2, key, isEmphasized, icon } = _b3, rest = __objRest(_b3, ["onClick", "label", "key", "isEmphasized", "icon"]);
5641
- const active = activeItem && activeItem === key;
5642
- const itemClass = cn19(
5643
- itemClassname,
5644
- "group flex cursor-pointer items-center px-4 py-2 text-sm transition-all",
5645
- {
5646
- "text-red-500": isEmphasized
5647
- },
5648
- {
5649
- "text-gray-900": !isEmphasized
5650
- },
5651
- {
5652
- "bg-gray-100 text-gray-900": active
5653
- },
5654
- active ? activeItemClassname : "",
5655
- {
5656
- "bg-gray-100 text-red-500 hover:text-red-500": active && isEmphasized
5657
- },
5658
- itemClassname
5659
- );
5660
- return /* @__PURE__ */ React17.createElement("li", { key }, /* @__PURE__ */ React17.createElement(
5661
- "button",
5662
- __spreadValues({}, __spreadValues({
5663
- onClick: () => {
5664
- setActiveItem(key);
5665
- onClick && onClick();
5666
- },
5817
+ return /* @__PURE__ */ React20.createElement(React20.Fragment, { key: `${idx}-list-${id2}` }, itemStack.map(
5818
+ (_a3) => {
5819
+ var _b3 = _a3, {
5820
+ onClick,
5821
+ label: label2,
5667
5822
  key,
5668
- className: cn19(itemClass, "w-full")
5669
- }, rest)),
5670
- /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-x-4" }, icon && (icon.pos === "leading" || (icon == null ? void 0 : icon.pos) === void 0) && /* @__PURE__ */ React17.createElement(
5671
- DynamicIcon,
5672
- __spreadValues({}, {
5673
- icon: icon.name,
5674
- className: cn19(
5675
- icon.className,
5676
- {
5677
- "text-red-500": isEmphasized
5678
- },
5679
- "opacity-60 group-hover:opacity-100"
5680
- ),
5681
- outline: icon.outline
5682
- })
5683
- ), /* @__PURE__ */ React17.createElement("div", { className: "whitespace-nowrap" }, label2), icon && icon.pos === "trailing" && /* @__PURE__ */ React17.createElement(
5684
- DynamicIcon,
5685
- __spreadValues({}, {
5686
- icon: icon.name,
5687
- className: cn19(
5688
- icon.className,
5689
- {
5690
- "text-red-500": isEmphasized
5691
- },
5692
- "opacity-60 group-"
5693
- ),
5694
- outline: icon.outline
5695
- })
5696
- ))
5697
- ));
5698
- }));
5823
+ isEmphasized,
5824
+ icon,
5825
+ iconPosition
5826
+ } = _b3, rest = __objRest(_b3, [
5827
+ "onClick",
5828
+ "label",
5829
+ "key",
5830
+ "isEmphasized",
5831
+ "icon",
5832
+ "iconPosition"
5833
+ ]);
5834
+ const active = activeItem && activeItem === key;
5835
+ const itemClass = cn20(
5836
+ itemClassname,
5837
+ "group flex cursor-pointer items-center px-4 py-2 text-sm transition-all",
5838
+ {
5839
+ "text-red-500": isEmphasized
5840
+ },
5841
+ {
5842
+ "text-gray-900": !isEmphasized
5843
+ },
5844
+ {
5845
+ "bg-gray-100 text-gray-900": active
5846
+ },
5847
+ active ? activeItemClassname : "",
5848
+ {
5849
+ "bg-gray-100 text-red-500 hover:text-red-500": active && isEmphasized
5850
+ },
5851
+ itemClassname
5852
+ );
5853
+ return /* @__PURE__ */ React20.createElement("li", { key }, /* @__PURE__ */ React20.createElement(
5854
+ "button",
5855
+ __spreadValues({}, __spreadValues({
5856
+ onClick: () => {
5857
+ setActiveItem(key);
5858
+ onClick && onClick();
5859
+ },
5860
+ key,
5861
+ className: cn20(itemClass, "w-full")
5862
+ }, rest)),
5863
+ /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-x-4" }, icon && (iconPosition === "leading" || iconPosition === void 0) && (typeof icon === "string" ? /* @__PURE__ */ React20.createElement(
5864
+ DynamicIcon,
5865
+ __spreadValues({}, {
5866
+ icon,
5867
+ className: cn20(
5868
+ {
5869
+ "text-red-500": isEmphasized
5870
+ },
5871
+ "opacity-60 group"
5872
+ )
5873
+ })
5874
+ ) : /* @__PURE__ */ React20.createElement(
5875
+ DynamicIcon,
5876
+ __spreadValues({}, __spreadProps(__spreadValues({}, icon), {
5877
+ className: cn20(
5878
+ icon.className,
5879
+ {
5880
+ "text-red-500": isEmphasized
5881
+ },
5882
+ "opacity-60 group"
5883
+ )
5884
+ }))
5885
+ )), /* @__PURE__ */ React20.createElement("div", { className: "whitespace-nowrap" }, label2), icon && iconPosition === "trailing" && (typeof icon === "string" ? /* @__PURE__ */ React20.createElement(
5886
+ DynamicIcon,
5887
+ __spreadValues({}, {
5888
+ icon,
5889
+ className: cn20(
5890
+ {
5891
+ "text-red-500": isEmphasized
5892
+ },
5893
+ "opacity-60 group"
5894
+ )
5895
+ })
5896
+ ) : /* @__PURE__ */ React20.createElement(
5897
+ DynamicIcon,
5898
+ __spreadValues({}, __spreadProps(__spreadValues({}, icon), {
5899
+ className: cn20(
5900
+ icon.className,
5901
+ {
5902
+ "text-red-500": isEmphasized
5903
+ },
5904
+ "opacity-60 group"
5905
+ )
5906
+ }))
5907
+ )))
5908
+ ));
5909
+ }
5910
+ ));
5699
5911
  })
5700
5912
  )
5701
5913
  )))
@@ -5709,39 +5921,39 @@ var DropdownComponent_default2 = DropdownComponent_default;
5709
5921
  // stories/organisms/ButtonDropdown/ButtonDropdown.tsx
5710
5922
  var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
5711
5923
  const dropDownClasses = __spreadProps(__spreadValues({}, defaultClassNames), {
5712
- groupClassname: cn20(
5924
+ groupClassname: cn21(
5713
5925
  "flex items-center justify-center rounded-l-none border !border-l-0 rounded-r px-2 transition-all hover:!border-l-0",
5714
5926
  button.actionType === "primary" ? "border-purple-600 bg-purple-600 !text-white hover:border-purple-700 hover:bg-purple-700 active:!border-purple-800 active:!bg-purple-800 fill-white" : "",
5715
5927
  button.actionType === "secondary" ? "border-purple-50 bg-purple-50 !text-purple-700 hover:border-purple-100 hover:bg-purple-100 active:!border-purple-300 active:!bg-purple-300 fill-purple-700" : "",
5716
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" : ""
5717
5929
  )
5718
5930
  });
5719
- return /* @__PURE__ */ React18.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__ */ React18.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(
5720
5932
  Button_default2,
5721
5933
  __spreadValues({}, __spreadProps(__spreadValues({}, button), {
5722
- className: cn20(
5934
+ className: cn21(
5723
5935
  button.className,
5724
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"
5725
5937
  )
5726
5938
  }))
5727
- ), /* @__PURE__ */ React18.createElement(
5939
+ ), /* @__PURE__ */ React21.createElement(
5728
5940
  "div",
5729
5941
  {
5730
- className: cn20(
5942
+ className: cn21(
5731
5943
  "w-[1px] rt",
5732
5944
  button.actionType === "primary" ? "bg-purple-700" : "",
5733
5945
  button.actionType === "secondary" ? "bg-purple-200" : "",
5734
5946
  button.actionType === "alternative" ? "bg-gray-300" : ""
5735
5947
  )
5736
5948
  }
5737
- ), /* @__PURE__ */ React18.createElement(
5949
+ ), /* @__PURE__ */ React21.createElement(
5738
5950
  DropdownComponent_default2,
5739
5951
  __spreadValues({}, __spreadProps(__spreadValues({}, dropDown), {
5740
- CustomDropdownTrigger: /* @__PURE__ */ React18.createElement(
5952
+ CustomDropdownTrigger: /* @__PURE__ */ React21.createElement(
5741
5953
  DynamicIcon,
5742
5954
  __spreadValues({}, {
5743
5955
  icon: "ChevronDownIcon",
5744
- className: cn20("h-5 w-5", {
5956
+ className: cn21("h-5 w-5", {
5745
5957
  "text-white": button.actionType === "primary",
5746
5958
  "text-purple-700": button.actionType === "secondary",
5747
5959
  "text-gray-700": button.actionType === "alternative"
@@ -5758,7 +5970,7 @@ var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
5758
5970
  },
5759
5971
  placement
5760
5972
  }))
5761
- ), /* @__PURE__ */ React18.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" }));
5762
5974
  };
5763
5975
  var ButtonDropdown_default = ButtonDropdown;
5764
5976
 
@@ -5766,8 +5978,8 @@ var ButtonDropdown_default = ButtonDropdown;
5766
5978
  var ButtonDropdown_default2 = ButtonDropdown_default;
5767
5979
 
5768
5980
  // stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx
5769
- import React19 from "react";
5770
- import { default as cn21 } from "classnames";
5981
+ import React22 from "react";
5982
+ import { default as cn22 } from "classnames";
5771
5983
  var EmptySectionPlaceholder = ({
5772
5984
  icon,
5773
5985
  mutedText,
@@ -5776,7 +5988,7 @@ var EmptySectionPlaceholder = ({
5776
5988
  actions,
5777
5989
  isWide
5778
5990
  }) => {
5779
- return /* @__PURE__ */ React19.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center border-2 border-dashed border-gray-300 p-5" }, /* @__PURE__ */ React19.createElement(IconWithShadow_default, __spreadValues({}, icon)), mutedText && /* @__PURE__ */ React19.createElement("p", { className: "my-2 block text-xs text-gray-500" }, mutedText), CallToActionComponent ? CallToActionComponent : /* @__PURE__ */ React19.createElement("p", { className: "mb-2 block text-sm font-medium text-gray-600" }, primaryMessage), actions.length > 0 ? /* @__PURE__ */ React19.createElement("div", { className: cn21("mt-2 flex gap-2", isWide ? "" : "flex-col items-center") }, actions.map((action, index) => /* @__PURE__ */ React19.createElement(Button_default2, __spreadProps(__spreadValues({}, __spreadValues({}, action)), { key: action.label.replaceAll(" ", "-") })))) : /* @__PURE__ */ React19.createElement(React19.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));
5780
5992
  };
5781
5993
  var EmptySectionPlaceholder_default = EmptySectionPlaceholder;
5782
5994
 
@@ -5784,8 +5996,8 @@ var EmptySectionPlaceholder_default = EmptySectionPlaceholder;
5784
5996
  var EmptySectionPlaceholder_default2 = EmptySectionPlaceholder_default;
5785
5997
 
5786
5998
  // stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx
5787
- import React20, { useLayoutEffect as useLayoutEffect2, useRef, useState as useState6 } from "react";
5788
- import { default as cn22 } from "classnames";
5999
+ import React23, { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState8 } from "react";
6000
+ import { default as cn23 } from "classnames";
5789
6001
  var FormInputWithAddons = (_a) => {
5790
6002
  var _b = _a, {
5791
6003
  handleChange,
@@ -5834,34 +6046,34 @@ var FormInputWithAddons = (_a) => {
5834
6046
  "customIconClass",
5835
6047
  "type"
5836
6048
  ]);
5837
- const leadLabelRef = useRef(null);
5838
- const trailLabelRef = useRef(null);
5839
- const [leadLabelWidth, setLeadLabelWidth] = useState6(0);
5840
- const [trailLabelWidth, setTrailLabelWidth] = useState6(0);
6049
+ const leadLabelRef = useRef2(null);
6050
+ const trailLabelRef = useRef2(null);
6051
+ const [leadLabelWidth, setLeadLabelWidth] = useState8(0);
6052
+ const [trailLabelWidth, setTrailLabelWidth] = useState8(0);
5841
6053
  useLayoutEffect2(() => {
5842
6054
  var _a2, _b2;
5843
6055
  setLeadLabelWidth(((_a2 = leadLabelRef.current) == null ? void 0 : _a2.clientWidth) || 0);
5844
6056
  setTrailLabelWidth(((_b2 = trailLabelRef.current) == null ? void 0 : _b2.clientWidth) || 0);
5845
6057
  }, []);
5846
- return /* @__PURE__ */ React20.createElement("div", { className: cn22("group flex flex-col", containerClassName) }, !leadLabel && !trailLabel && topLabel && /* @__PURE__ */ React20.createElement("label", { htmlFor: id2, className: cn22("flex items-center text-sm font-medium text-gray-600", labelClass) }, topLabel), description && /* @__PURE__ */ React20.createElement("div", { className: "mb-2 text-sm text-gray-500" }, description), /* @__PURE__ */ React20.createElement("div", { className: "relative flex-grow" }, (leadLabel || leadIcon) && /* @__PURE__ */ React20.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(
5847
6059
  "label",
5848
6060
  {
5849
6061
  ref: leadLabelRef,
5850
6062
  htmlFor: id2,
5851
- className: cn22(
6063
+ className: cn23(
5852
6064
  "absolute top-0 bottom-0 left-3 flex items-center justify-center text-sm text-gray-500",
5853
6065
  labelClass
5854
6066
  )
5855
6067
  },
5856
- leadIcon && /* @__PURE__ */ React20.createElement("span", null, /* @__PURE__ */ React20.createElement(
6068
+ leadIcon && /* @__PURE__ */ React23.createElement("span", null, /* @__PURE__ */ React23.createElement(
5857
6069
  DynamicIcon,
5858
6070
  __spreadValues({}, __spreadProps(__spreadValues({}, leadIcon), {
5859
- className: cn22("h-5 w-5 text-gray-400", leadIconClassNames, customIconClass),
6071
+ className: cn23("h-5 w-5 text-gray-400", leadIconClassNames, customIconClass),
5860
6072
  outline: iconOutlined
5861
6073
  }))
5862
6074
  )),
5863
6075
  leadLabel && leadLabel
5864
- ), /* @__PURE__ */ React20.createElement(
6076
+ ), /* @__PURE__ */ React23.createElement(
5865
6077
  InputField_default2,
5866
6078
  __spreadValues({}, __spreadProps(__spreadValues({}, rest), {
5867
6079
  handleChange,
@@ -5881,20 +6093,20 @@ var FormInputWithAddons = (_a) => {
5881
6093
  paddingLeft: `${leadLabelWidth + addonOffset}px`
5882
6094
  }
5883
6095
  }))
5884
- ), (trailLabel || trailIcon) && /* @__PURE__ */ React20.createElement(
6096
+ ), (trailLabel || trailIcon) && /* @__PURE__ */ React23.createElement(
5885
6097
  "label",
5886
6098
  {
5887
6099
  ref: trailLabelRef,
5888
6100
  htmlFor: id2,
5889
- className: cn22(
6101
+ className: cn23(
5890
6102
  "right absolute top-0 bottom-0 right-3 flex items-center justify-center text-sm !text-gray-500 ",
5891
6103
  labelClass
5892
6104
  )
5893
6105
  },
5894
- trailIcon && /* @__PURE__ */ React20.createElement("span", null, /* @__PURE__ */ React20.createElement(
6106
+ trailIcon && /* @__PURE__ */ React23.createElement("span", null, /* @__PURE__ */ React23.createElement(
5895
6107
  DynamicIcon,
5896
6108
  __spreadValues({}, __spreadProps(__spreadValues({}, trailIcon), {
5897
- className: cn22("h-5 w-5 text-gray-400", customIconClass),
6109
+ className: cn23("h-5 w-5 text-gray-400", customIconClass),
5898
6110
  outline: iconOutlined
5899
6111
  }))
5900
6112
  )),
@@ -5905,6 +6117,152 @@ var FormInputWithAddons_default = FormInputWithAddons;
5905
6117
 
5906
6118
  // stories/organisms/FormInputWithAddons/index.tsx
5907
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;
5908
6266
  export {
5909
6267
  AnimatedLabelInput_default2 as AnimatedLabelInput,
5910
6268
  Avatar_default2 as Avatar,
@@ -5926,7 +6284,9 @@ export {
5926
6284
  NProgress_default as RadialProgress,
5927
6285
  radio_default as Radio,
5928
6286
  select_default as Select,
5929
- textArea_default as TextAreaField,
6287
+ TextInput_default2 as TextInput,
6288
+ TextInputSelect_default2 as TextInputSelect,
6289
+ textArea_default as Textarea,
5930
6290
  toggleSwitch_default as ToggleSwitch,
5931
6291
  isFAIcon,
5932
6292
  isHeroIcon,