@bubo-squared/ui-framework 0.1.93 → 0.1.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -169,22 +169,34 @@ Button.displayName = "Button";
169
169
  var import_class_variance_authority2 = require("class-variance-authority");
170
170
  var import_jsx_runtime3 = require("react/jsx-runtime");
171
171
  var buttonGroupVariants = (0, import_class_variance_authority2.cva)(
172
- "flex items-center justify-center gap-4 pt-4 w-[320px] min-w-[320px]",
172
+ "flex items-center justify-center gap-4 pt-4 w-fit",
173
173
  {
174
174
  variants: {
175
- variant: {
175
+ orientation: {
176
176
  vertical: ["flex-col"],
177
177
  horizontal: ["flex-row"]
178
178
  }
179
179
  },
180
180
  defaultVariants: {
181
- variant: "horizontal"
181
+ orientation: "horizontal"
182
182
  }
183
183
  }
184
184
  );
185
185
  var ButtonGroup = (props) => {
186
- const { orientation = "horizontal" } = props;
187
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: buttonGroupVariants({ variant: orientation }), ...props, children: props.children });
186
+ const {
187
+ orientation = "horizontal",
188
+ className,
189
+ children,
190
+ ...rest
191
+ } = props;
192
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
193
+ "div",
194
+ {
195
+ className: cn(buttonGroupVariants({ orientation }), className),
196
+ ...rest,
197
+ children
198
+ }
199
+ );
188
200
  };
189
201
 
190
202
  // src/components/Buttons/IconButton.tsx
@@ -523,7 +535,7 @@ var Avatar = React6.forwardRef(
523
535
  className: "w-full h-full object-cover"
524
536
  }
525
537
  ) : null,
526
- !hasImage && variant === "initial" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: cn(avatarInitialsVariants({ size }), "relative bottom-px"), style: { marginBottom: 0 }, children: initials }),
538
+ !hasImage && variant === "initial" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: cn(avatarInitialsVariants({ size }), "relative bottom-px"), children: initials }),
527
539
  !hasImage && variant === "icon" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: cn(avatarIconVariants({ size })), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons.UserIcon, {}) })
528
540
  ]
529
541
  }
@@ -584,7 +596,6 @@ var Badge = React7.forwardRef(
584
596
  ref,
585
597
  className: cn(badgeVariants({ size, variant }), className),
586
598
  ...rest,
587
- style: { marginBottom: 0 },
588
599
  children: value ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
589
600
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-normal", children: label }),
590
601
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-normal", children: ":" }),
@@ -638,7 +649,6 @@ var BadgeDigit = React8.forwardRef(
638
649
  {
639
650
  ref,
640
651
  className: cn(badgeDigitVariants({ size, variant }), className),
641
- style: { marginBottom: 0 },
642
652
  ...rest,
643
653
  children: String(value)
644
654
  }
@@ -701,7 +711,7 @@ var BadgeStatus = React10.forwardRef(
701
711
  )
702
712
  }
703
713
  ),
704
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: textClasses, style: { marginBottom: 0 }, children: label })
714
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: textClasses, children: label })
705
715
  ]
706
716
  }
707
717
  );
@@ -713,60 +723,128 @@ BadgeStatus.displayName = "BadgeStatus";
713
723
  var React11 = require("react");
714
724
  var import_icons2 = require("@bubo-squared/icons");
715
725
  var import_jsx_runtime13 = require("react/jsx-runtime");
716
- var lineClass = "h-px flex-1 bg-(--border-secondary)";
726
+ var lineClassBase = "flex-1 bg-(--border-secondary) h-px";
727
+ var gapBySize = {
728
+ sm: "gap-2",
729
+ md: "gap-3",
730
+ lg: "gap-4",
731
+ xl: "gap-4"
732
+ };
733
+ var textClassBySize = {
734
+ sm: "footnote",
735
+ md: "caption",
736
+ lg: "paragraph-s",
737
+ xl: "paragraph-m"
738
+ };
717
739
  var Divider = (props) => {
718
- const { type = "line", className, ...rest } = props;
719
- const showCenter = type !== "line";
720
- const textLabel = type === "text-lines" && "label" in rest && rest.label ? rest.label : "OR";
721
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
722
- "div",
723
- {
724
- className: cn(
725
- "flex w-full items-center",
726
- showCenter ? "gap-2" : "gap-0",
727
- className
728
- ),
729
- ...rest,
730
- children: [
731
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass }),
732
- type === "text-lines" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
733
- "span",
734
- {
735
- className: "footnote text-(--text-secondary)",
736
- style: { marginBottom: 0 },
737
- children: textLabel
738
- }
739
- ),
740
- type === "icon-lines" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
741
- IconButton,
742
- {
743
- variant: props.type === "icon-lines" && props.iconButtonVariant ? props.iconButtonVariant : "secondary",
744
- size: "sm",
745
- "aria-label": props.type === "icon-lines" && props.ariaLabel ? props.ariaLabel : textLabel || "More options",
746
- icon: props.type === "icon-lines" ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons2.TargetIcon, {}),
747
- onClick: props.type === "icon-lines" ? props.onIconClick : void 0
748
- }
749
- ),
750
- type === "icon-group-lines" && (props.type === "icon-group-lines" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
751
- IconButtonGroup,
752
- {
753
- items: props.iconGroupItems,
754
- size: props.iconGroupSize
755
- }
756
- ) : null),
757
- type === "button-lines" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
758
- Button,
759
- {
760
- variant: props.type === "button-lines" && props.buttonVariant ? props.buttonVariant : "secondary",
761
- size: "md",
762
- onClick: props.type === "button-lines" ? props.onButtonClick : void 0,
763
- children: props.type === "button-lines" ? props.buttonLabel : "Label"
764
- }
765
- ),
766
- showCenter && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass })
767
- ]
768
- }
740
+ const resolvedType = props.type ?? "default";
741
+ const resolvedSize = props.size ?? "sm";
742
+ const showCenter = resolvedType !== "default";
743
+ const lineClass = lineClassBase;
744
+ const wrapperClass = cn(
745
+ "flex w-full items-center",
746
+ showCenter ? gapBySize[resolvedSize] : "gap-0",
747
+ props.className
769
748
  );
749
+ if (props.type === void 0 || props.type === "default") {
750
+ const {
751
+ type: _type,
752
+ size: _size,
753
+ label: _label,
754
+ className: _className,
755
+ ...divProps
756
+ } = props;
757
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: wrapperClass, ...divProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass }) });
758
+ }
759
+ if (props.type === "text") {
760
+ const {
761
+ type: _type,
762
+ size: _size,
763
+ label,
764
+ className: _className,
765
+ ...divProps
766
+ } = props;
767
+ const textLabel = label ? label : "OR";
768
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: wrapperClass, ...divProps, children: [
769
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass }),
770
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
771
+ "span",
772
+ {
773
+ className: cn(
774
+ textClassBySize[resolvedSize],
775
+ "text-(--text-secondary)"
776
+ ),
777
+ children: textLabel
778
+ }
779
+ ),
780
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass })
781
+ ] });
782
+ }
783
+ if (props.type === "iconButton") {
784
+ const {
785
+ type: _type,
786
+ size: _size,
787
+ icon,
788
+ iconButtonVariant,
789
+ onIconClick,
790
+ ariaLabel,
791
+ className: _className,
792
+ ...divProps
793
+ } = props;
794
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: wrapperClass, ...divProps, children: [
795
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass }),
796
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
797
+ IconButton,
798
+ {
799
+ variant: iconButtonVariant ?? "secondary",
800
+ size: resolvedSize,
801
+ "aria-label": ariaLabel ?? "More options",
802
+ icon: icon ?? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons2.TargetIcon, {}),
803
+ onClick: onIconClick
804
+ }
805
+ ),
806
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass })
807
+ ] });
808
+ }
809
+ if (props.type === "iconButtonGroup") {
810
+ const {
811
+ type: _type,
812
+ size: _size,
813
+ iconGroupItems,
814
+ className: _className,
815
+ ...divProps
816
+ } = props;
817
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: wrapperClass, ...divProps, children: [
818
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass }),
819
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButtonGroup, { items: iconGroupItems, size: resolvedSize }),
820
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass })
821
+ ] });
822
+ }
823
+ if (props.type === "button") {
824
+ const {
825
+ type: _type,
826
+ size: _size,
827
+ buttonLabel,
828
+ onButtonClick,
829
+ buttonVariant,
830
+ className: _className,
831
+ ...divProps
832
+ } = props;
833
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: wrapperClass, ...divProps, children: [
834
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass }),
835
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
836
+ Button,
837
+ {
838
+ variant: buttonVariant ?? "secondary",
839
+ size: resolvedSize,
840
+ onClick: onButtonClick,
841
+ children: buttonLabel
842
+ }
843
+ ),
844
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: lineClass })
845
+ ] });
846
+ }
847
+ return null;
770
848
  };
771
849
  Divider.displayName = "Divider";
772
850
 
@@ -806,8 +884,8 @@ var Progress = React12.forwardRef(
806
884
  ...rest,
807
885
  children: [
808
886
  showLabel && label && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex w-full items-center justify-between", children: [
809
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "paragraph-s-bold text-(--text-primary)", style: { marginBottom: 0 }, children: label }),
810
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "footnote text-(--text-secondary)", style: { marginBottom: 0 }, children: percentageLabel })
887
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "paragraph-s-bold text-(--text-primary)", children: label }),
888
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "footnote text-(--text-secondary)", children: percentageLabel })
811
889
  ] }),
812
890
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn("w-full bg-(--chart-mono) overflow-hidden", barHeightClasses), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
813
891
  "div",
@@ -819,7 +897,7 @@ var Progress = React12.forwardRef(
819
897
  style: { width: `${clamped}%` }
820
898
  }
821
899
  ) }),
822
- showHint && hint && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "caption text-(--text-secondary)", style: { marginBottom: 0 }, children: hint })
900
+ showHint && hint && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "caption text-(--text-secondary)", children: hint })
823
901
  ]
824
902
  }
825
903
  );
@@ -977,7 +1055,7 @@ function Checkbox({ label, className, ...props }) {
977
1055
  ] })
978
1056
  }
979
1057
  ),
980
- label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "paragraph-m-medium text-(--text-primary)", style: { marginBottom: 0 }, children: label })
1058
+ label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "paragraph-m-medium text-(--text-primary)", children: label })
981
1059
  ] });
982
1060
  }
983
1061
 
@@ -986,7 +1064,7 @@ var React16 = __toESM(require("react"), 1);
986
1064
  var import_class_variance_authority12 = require("class-variance-authority");
987
1065
  var import_icons6 = require("@bubo-squared/icons");
988
1066
  var import_jsx_runtime18 = require("react/jsx-runtime");
989
- var dropdownWrapperBase = "flex flex-col gap-2 items-start min-w-[343px]";
1067
+ var dropdownWrapperBase = "flex flex-col gap-2 items-start";
990
1068
  var dropdownTriggerVariants = (0, import_class_variance_authority12.cva)(
991
1069
  "group flex w-full items-center justify-between rounded-4 border bg-(--background-primary) px-3 py-2 text-left transition-colors cursor-pointer focus-ring-primary focus:border-(--border-brand) hover:bg-(--background-primary-hover) disabled:bg-(--background-primary) disabled:border-(--border-secondary-disabled) disabled:text-(--text-primary-disabled) disabled:cursor-default",
992
1070
  {
@@ -1047,7 +1125,7 @@ var Dropdown = (props) => {
1047
1125
  label = "Field Label",
1048
1126
  showLabel = true,
1049
1127
  hint = "This is a hint text to help user.",
1050
- showHint = true,
1128
+ hideHint = false,
1051
1129
  placeholder = "Placeholder text",
1052
1130
  size = "large",
1053
1131
  status = "default",
@@ -1111,7 +1189,6 @@ var Dropdown = (props) => {
1111
1189
  "paragraph-s",
1112
1190
  disabled ? "text-(--text-primary-disabled)" : "text-(--text-primary)"
1113
1191
  ),
1114
- style: { marginBottom: 0 },
1115
1192
  children: label
1116
1193
  }
1117
1194
  ),
@@ -1124,7 +1201,7 @@ var Dropdown = (props) => {
1124
1201
  "aria-haspopup": "listbox",
1125
1202
  "aria-expanded": isOpen,
1126
1203
  "aria-labelledby": showLabel ? labelId : void 0,
1127
- "aria-describedby": showHint ? hintId : void 0,
1204
+ "aria-describedby": !hideHint ? hintId : void 0,
1128
1205
  disabled,
1129
1206
  className: cn(
1130
1207
  dropdownTriggerVariants({ size, status }),
@@ -1144,7 +1221,6 @@ var Dropdown = (props) => {
1144
1221
  disabled: !!disabled
1145
1222
  })
1146
1223
  ),
1147
- style: { marginBottom: 0 },
1148
1224
  children: hasValue ? selectedOption?.label : placeholder
1149
1225
  }
1150
1226
  ),
@@ -1174,7 +1250,6 @@ var Dropdown = (props) => {
1174
1250
  {
1175
1251
  type: "button",
1176
1252
  className: "flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) py-(--space-8) text-left paragraph-l text-(--text-primary) hover:bg-(--background-secondary)",
1177
- style: { marginBottom: 0 },
1178
1253
  role: "option",
1179
1254
  "aria-selected": selected,
1180
1255
  onClick: () => handleSelect(opt.value),
@@ -1186,7 +1261,7 @@ var Dropdown = (props) => {
1186
1261
  );
1187
1262
  }) }) })
1188
1263
  ] }),
1189
- showHint && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1264
+ !hideHint && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1190
1265
  "p",
1191
1266
  {
1192
1267
  id: hintId,
@@ -1194,7 +1269,6 @@ var Dropdown = (props) => {
1194
1269
  "caption",
1195
1270
  disabled ? "text-(--text-primary-disabled)" : "text-(--text-secondary)"
1196
1271
  ),
1197
- style: { marginBottom: 0 },
1198
1272
  children: hint
1199
1273
  }
1200
1274
  )
@@ -1205,11 +1279,12 @@ Dropdown.displayName = "Dropdown";
1205
1279
  // src/components/Inputs/Field.tsx
1206
1280
  var React17 = __toESM(require("react"), 1);
1207
1281
  var import_jsx_runtime19 = require("react/jsx-runtime");
1208
- var fieldBase = "flex flex-col gap-2 items-start min-w-[343px]";
1282
+ var fieldBase = "flex flex-col gap-2 items-start";
1209
1283
  var Field = (props) => {
1210
1284
  const {
1211
1285
  label,
1212
1286
  hint,
1287
+ hideHint,
1213
1288
  status = "default",
1214
1289
  disabled,
1215
1290
  className,
@@ -1226,17 +1301,15 @@ var Field = (props) => {
1226
1301
  {
1227
1302
  id: labelId,
1228
1303
  className: cn("paragraph-s", labelColorClass),
1229
- style: { marginBottom: 0 },
1230
1304
  children: label
1231
1305
  }
1232
1306
  ),
1233
1307
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative w-full", children }),
1234
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1308
+ !hideHint && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1235
1309
  "p",
1236
1310
  {
1237
1311
  id: hint ? hintId : void 0,
1238
1312
  className: cn("caption", hint ? hintColorClass : "invisible"),
1239
- style: { marginBottom: 0 },
1240
1313
  children: hint || "\xA0"
1241
1314
  }
1242
1315
  )
@@ -1375,6 +1448,7 @@ var PasswordInput = (props) => {
1375
1448
  const {
1376
1449
  label,
1377
1450
  hint,
1451
+ hideHint,
1378
1452
  placeholder = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
1379
1453
  size = "large",
1380
1454
  status = "default",
@@ -1414,6 +1488,7 @@ var PasswordInput = (props) => {
1414
1488
  {
1415
1489
  label,
1416
1490
  hint,
1491
+ hideHint,
1417
1492
  status,
1418
1493
  disabled,
1419
1494
  children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
@@ -1448,7 +1523,6 @@ var PasswordInput = (props) => {
1448
1523
  className: cn(
1449
1524
  passwordTextVariants({ size, disabled: !!disabled })
1450
1525
  ),
1451
- style: { marginBottom: 0 },
1452
1526
  ...inputProps
1453
1527
  }
1454
1528
  ),
@@ -1465,7 +1539,6 @@ var PasswordInput = (props) => {
1465
1539
  "button",
1466
1540
  {
1467
1541
  type: "button",
1468
- style: { marginBottom: 0 },
1469
1542
  className: cn(
1470
1543
  actionButtonVariants({ size, disabled: !!disabled })
1471
1544
  ),
@@ -1790,6 +1863,7 @@ var PhoneInput = React26.forwardRef(
1790
1863
  value,
1791
1864
  label,
1792
1865
  hint,
1866
+ hideHint,
1793
1867
  placeholder,
1794
1868
  size = "large",
1795
1869
  disabled = false,
@@ -1801,6 +1875,7 @@ var PhoneInput = React26.forwardRef(
1801
1875
  {
1802
1876
  label,
1803
1877
  hint,
1878
+ hideHint,
1804
1879
  status,
1805
1880
  disabled,
1806
1881
  className,
@@ -1812,7 +1887,6 @@ var PhoneInput = React26.forwardRef(
1812
1887
  sizeBase({ size }),
1813
1888
  inputTextVariants({ size, disabled })
1814
1889
  ),
1815
- style: { marginBottom: 0 },
1816
1890
  flagComponent: FlagComponent,
1817
1891
  countrySelectComponent: CountrySelect,
1818
1892
  inputComponent: InputComponent,
@@ -1890,44 +1964,51 @@ var CountrySelect = ({
1890
1964
  ]
1891
1965
  }
1892
1966
  ) }),
1893
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PopoverContent, { className: "w-[300px] p-0 relative left-4.5 bg-(--background-primary) shadow-card-md rounded-4 border-none outline-1 outline-solid outline-(--border-primary-hover) **:data-[slot='command-input-wrapper']:border-b-(--border-secondary)", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Command, { children: [
1894
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1895
- CommandInput,
1896
- {
1897
- value: searchValue,
1898
- onValueChange: (value) => {
1899
- setSearchValue(value);
1900
- setTimeout(() => {
1901
- if (scrollAreaRef.current) {
1902
- const viewportElement = scrollAreaRef.current.querySelector(
1903
- "[data-radix-scroll-area-viewport]"
1904
- );
1905
- if (viewportElement) {
1906
- viewportElement.scrollTop = 0;
1907
- }
1908
- }
1909
- }, 0);
1910
- },
1911
- placeholder: "Search country..."
1912
- }
1913
- ),
1914
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandList, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ScrollArea, { ref: scrollAreaRef, className: "h-72", children: [
1915
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandEmpty, { children: "No country found." }),
1916
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandGroup, { className: "[&>div>div]:pl-4 [&>div>div]:pr-2 [&>div>div]:py-2 [&>div>div]:border-b [&>div>div]:border-b-(--border-secondary) [&>div>div]:cursor-pointer [&>div>div]:hover:bg-(--background-primary-hover) [&>div>div]:text-(--text-primary) [&>div>div]:hover:text-(--text-primary) p-0 pr-4", children: countryList.map(
1917
- ({ value, label }) => value ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1918
- CountrySelectOption,
1967
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1968
+ PopoverContent,
1969
+ {
1970
+ align: "start",
1971
+ className: "p-0 bg-(--background-primary) shadow-card-md rounded-4 border-none outline-1 outline-solid outline-(--border-primary-hover) **:data-[slot='command-input-wrapper']:border-b-(--border-secondary)",
1972
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Command, { children: [
1973
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1974
+ CommandInput,
1919
1975
  {
1920
- country: value,
1921
- countryName: label,
1922
- selectedCountry,
1923
- onChange,
1924
- onSelectComplete: () => setIsOpen(false)
1925
- },
1926
- value
1927
- ) : null
1928
- ) })
1929
- ] }) })
1930
- ] }) })
1976
+ value: searchValue,
1977
+ onValueChange: (value) => {
1978
+ setSearchValue(value);
1979
+ setTimeout(() => {
1980
+ if (scrollAreaRef.current) {
1981
+ const viewportElement = scrollAreaRef.current.querySelector(
1982
+ "[data-radix-scroll-area-viewport]"
1983
+ );
1984
+ if (viewportElement) {
1985
+ viewportElement.scrollTop = 0;
1986
+ }
1987
+ }
1988
+ }, 0);
1989
+ },
1990
+ placeholder: "Search country..."
1991
+ }
1992
+ ),
1993
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandList, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ScrollArea, { ref: scrollAreaRef, className: "h-72", children: [
1994
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandEmpty, { children: "No country found." }),
1995
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandGroup, { className: "[&>div>div]:pl-4 [&>div>div]:pr-2 [&>div>div]:py-2 [&>div>div]:border-b [&>div>div]:border-b-(--border-secondary) [&>div>div]:cursor-pointer [&>div>div]:hover:bg-(--background-primary-hover) [&>div>div]:text-(--text-primary) [&>div>div]:hover:text-(--text-primary) p-0 pr-4", children: countryList.map(
1996
+ ({ value, label }) => value ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1997
+ CountrySelectOption,
1998
+ {
1999
+ country: value,
2000
+ countryName: label,
2001
+ selectedCountry,
2002
+ onChange,
2003
+ onSelectComplete: () => setIsOpen(false)
2004
+ },
2005
+ value
2006
+ ) : null
2007
+ ) })
2008
+ ] }) })
2009
+ ] })
2010
+ }
2011
+ )
1931
2012
  ]
1932
2013
  }
1933
2014
  );
@@ -1976,6 +2057,7 @@ var wrapperBase = "flex flex-col gap-2 items-start";
1976
2057
  var RadioGroup = ({
1977
2058
  label,
1978
2059
  hint,
2060
+ hideHint,
1979
2061
  options,
1980
2062
  orientation = "vertical",
1981
2063
  disabled = false,
@@ -1999,7 +2081,6 @@ var RadioGroup = ({
1999
2081
  "paragraph-s text-(--text-primary)",
2000
2082
  disabled && "text-(--text-primary-disabled)"
2001
2083
  ),
2002
- style: { marginBottom: 0 },
2003
2084
  children: label
2004
2085
  }
2005
2086
  ),
@@ -2080,7 +2161,6 @@ var RadioGroup = ({
2080
2161
  "paragraph-s text-(--text-primary)",
2081
2162
  "group-data-[disabled]:text-(--text-primary-disabled) whitespace-nowrap"
2082
2163
  ),
2083
- style: { marginBottom: 0 },
2084
2164
  children: option.label
2085
2165
  }
2086
2166
  )
@@ -2092,7 +2172,7 @@ var RadioGroup = ({
2092
2172
  ))
2093
2173
  }
2094
2174
  ),
2095
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2175
+ !hideHint && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2096
2176
  "p",
2097
2177
  {
2098
2178
  id: hintId,
@@ -2100,7 +2180,6 @@ var RadioGroup = ({
2100
2180
  "caption text-(--text-secondary)",
2101
2181
  disabled && "text-(--text-primary-disabled)"
2102
2182
  ),
2103
- style: { marginBottom: 0 },
2104
2183
  children: hint ?? "\xA0"
2105
2184
  }
2106
2185
  )
@@ -2154,7 +2233,7 @@ var SearchInput = (props) => {
2154
2233
  inputRef.current?.focus();
2155
2234
  };
2156
2235
  const showTrailingIcon = !!trailingIcon;
2157
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col gap-2 items-start min-w-[343px]", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "relative w-full", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2236
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col gap-2 items-start", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "relative w-full", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2158
2237
  InputShell,
2159
2238
  {
2160
2239
  size,
@@ -2175,7 +2254,6 @@ var SearchInput = (props) => {
2175
2254
  className: cn(
2176
2255
  searchTextVariants({ size })
2177
2256
  ),
2178
- style: { marginBottom: 0 },
2179
2257
  ...inputProps
2180
2258
  }
2181
2259
  ),
@@ -2189,7 +2267,7 @@ SearchInput.displayName = "SearchInput";
2189
2267
  // src/components/Inputs/Slider.tsx
2190
2268
  var React29 = __toESM(require("react"), 1);
2191
2269
  var import_jsx_runtime31 = require("react/jsx-runtime");
2192
- var wrapperBase2 = "flex flex-col gap-2 items-start min-w-[343px]";
2270
+ var wrapperBase2 = "flex flex-col gap-2 items-start";
2193
2271
  var Slider = (props) => {
2194
2272
  const {
2195
2273
  display = "flat",
@@ -2445,7 +2523,6 @@ var Slider = (props) => {
2445
2523
  "relative rounded-4 shadow-card-md px-(--space-8) py-(--space-4)",
2446
2524
  disabled ? "bg-(--background-primary-disabled)" : "bg-(--background-neutral)"
2447
2525
  ),
2448
- style: { marginBottom: 0 },
2449
2526
  children: [
2450
2527
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2451
2528
  "p",
@@ -2454,7 +2531,6 @@ var Slider = (props) => {
2454
2531
  "paragraph-s",
2455
2532
  disabled ? "text-(--text-primary-disabled)" : "text-(--text-primary)"
2456
2533
  ),
2457
- style: { marginBottom: 0 },
2458
2534
  children: labelText
2459
2535
  }
2460
2536
  ),
@@ -2507,7 +2583,7 @@ var Slider = (props) => {
2507
2583
  index
2508
2584
  );
2509
2585
  };
2510
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: wrapperBase2, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("w-[354px] flex flex-col gap-1", className), children: [
2586
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: wrapperBase2, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("w-full flex flex-col gap-1", className), children: [
2511
2587
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "relative w-full", children: [
2512
2588
  showTooltip && primary !== void 0 && renderTooltipBubble("primary", primaryPercent, formatDisplayValue(primary)),
2513
2589
  showTooltip && type === "multi" && secondary !== void 0 && renderTooltipBubble("secondary", secondaryPercent, formatDisplayValue(secondary)),
@@ -2548,7 +2624,6 @@ var Slider = (props) => {
2548
2624
  "paragraph-s text-(--text-primary)",
2549
2625
  disabled && "text-(--text-primary-disabled)"
2550
2626
  ),
2551
- style: { marginBottom: 0 },
2552
2627
  children: formatNumericLabel()
2553
2628
  }
2554
2629
  )
@@ -2651,7 +2726,6 @@ var TextArea = (props) => {
2651
2726
  "paragraph-s",
2652
2727
  disabled ? "text-(--text-primary-disabled)" : "text-(--text-primary)"
2653
2728
  ),
2654
- style: { marginBottom: 0 },
2655
2729
  children: label
2656
2730
  }
2657
2731
  ),
@@ -2692,7 +2766,6 @@ var TextArea = (props) => {
2692
2766
  disabled ? "text-(--text-primary-disabled)" : hasValue ? "text-(--text-primary)" : "text-(--text-secondary)",
2693
2767
  showCharacterLimit && "pr-16"
2694
2768
  ),
2695
- style: { marginBottom: 0 },
2696
2769
  ...textareaProps
2697
2770
  }
2698
2771
  ),
@@ -2735,7 +2808,6 @@ var TextArea = (props) => {
2735
2808
  {
2736
2809
  id: hint ? hintId : void 0,
2737
2810
  className: cn("caption", hint ? hintColorClass : "invisible"),
2738
- style: { marginBottom: 0 },
2739
2811
  children: hint || "\xA0"
2740
2812
  }
2741
2813
  )
@@ -2779,6 +2851,7 @@ var TextInput = (props) => {
2779
2851
  const {
2780
2852
  label,
2781
2853
  hint,
2854
+ hideHint,
2782
2855
  placeholder = "Placeholder text",
2783
2856
  size = "large",
2784
2857
  status = "default",
@@ -2814,6 +2887,7 @@ var TextInput = (props) => {
2814
2887
  {
2815
2888
  label,
2816
2889
  hint,
2890
+ hideHint,
2817
2891
  status,
2818
2892
  disabled,
2819
2893
  children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
@@ -2849,7 +2923,6 @@ var TextInput = (props) => {
2849
2923
  inputTextVariants2({ size }),
2850
2924
  "bg-transparent outline-none w-full"
2851
2925
  ),
2852
- style: { marginBottom: 0 },
2853
2926
  ...inputProps
2854
2927
  }
2855
2928
  ),
@@ -2952,7 +3025,6 @@ var Toggle = (props) => {
2952
3025
  "paragraph-s text-(--text-primary)",
2953
3026
  disabled && "text-(--text-primary-disabled)"
2954
3027
  ),
2955
- style: { marginBottom: 0 },
2956
3028
  children: label
2957
3029
  }
2958
3030
  )
@@ -3051,7 +3123,8 @@ var Popover2 = (props) => {
3051
3123
  onOk?.();
3052
3124
  setOpen(false);
3053
3125
  };
3054
- const popoverClasses = "bg-(--background-popover) fill-(--background-popover) popover w-80 shadow-card-md border-none [&_span]:scale-240 rounded-4";
3126
+ const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [&_span]:scale-240 rounded-4";
3127
+ const popoverArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_2px_1px_var(--color-b-black-12)] group-data-[side=bottom]:drop-shadow-[0px_-1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_var(--color-b-black-12)] group-data-[side=right]:drop-shadow-[0px_2px_1px_var(--color-b-black-12)]";
3055
3128
  const mapPlacementToSideAndAlign = (placement2) => {
3056
3129
  switch (placement2) {
3057
3130
  case "top":
@@ -3082,19 +3155,6 @@ var Popover2 = (props) => {
3082
3155
  return { side: "bottom", align: "center" };
3083
3156
  }
3084
3157
  };
3085
- const arrowShadowClass = (side2) => {
3086
- switch (side2) {
3087
- case "top":
3088
- return "drop-shadow(0px 2px 1px var(--color-b-black-12))";
3089
- case "bottom":
3090
- return "drop-shadow(0px -1px 1px color-mix(in srgb, var(--color-b-black-10) 66%, transparent))";
3091
- case "left":
3092
- case "right":
3093
- return "drop-shadow(0px 2px 1px var(--color-b-black-12))";
3094
- default:
3095
- return "";
3096
- }
3097
- };
3098
3158
  const { side, align } = mapPlacementToSideAndAlign(placement);
3099
3159
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
3100
3160
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PopoverTrigger, { asChild: true, children }),
@@ -3104,21 +3164,16 @@ var Popover2 = (props) => {
3104
3164
  side,
3105
3165
  align,
3106
3166
  sideOffset: offset,
3107
- className: cn(popoverClasses, side === "top" ? "[&_span]:bottom-1! " : "", className),
3167
+ className: cn(popoverClasses, className),
3108
3168
  children: [
3109
- showArrow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3110
- PopoverArrow,
3111
- {
3112
- style: { filter: arrowShadowClass(side) }
3113
- }
3114
- ),
3169
+ showArrow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PopoverArrow, { className: popoverArrowClasses }),
3115
3170
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid gap-4", children: [
3116
3171
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-2", children: [
3117
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "caption text-secondary", style: { marginBottom: 0 }, children: strapline }),
3118
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h4", { className: "subtitle-medium text-primary", style: { marginBottom: 0 }, children: title }),
3119
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "paragraph-s text-primary", style: { marginBottom: 0 }, children: description })
3172
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "caption text-secondary", children: strapline }),
3173
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h4", { className: "subtitle-medium text-primary", children: title }),
3174
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "paragraph-s text-primary", children: description })
3120
3175
  ] }),
3121
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex justify-start items-center gap-4", children: [
3176
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
3122
3177
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
3123
3178
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { size: "sm", variant: "primary", onClick: handleOk, children: okText || "Ok" })
3124
3179
  ] })