@bubo-squared/ui-framework 0.2.12 → 0.2.13

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
@@ -958,56 +958,112 @@ var Divider = (props) => {
958
958
  Divider.displayName = "Divider";
959
959
 
960
960
  // src/components/Content/Progress.tsx
961
+ var React14 = __toESM(require("react"), 1);
962
+
963
+ // src/components/Inputs/Field.tsx
961
964
  var React13 = __toESM(require("react"), 1);
962
965
  var import_jsx_runtime15 = require("react/jsx-runtime");
966
+ var fieldBase = "flex flex-col gap-2 items-start";
967
+ var Field = (props) => {
968
+ const {
969
+ label,
970
+ labelRight = false,
971
+ hint,
972
+ hideHint,
973
+ status = "default",
974
+ disabled,
975
+ className,
976
+ children
977
+ } = props;
978
+ const fieldId = React13.useId();
979
+ const labelId = label ? `${fieldId}-label` : void 0;
980
+ const hintId = hint ? `${fieldId}-hint` : void 0;
981
+ const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
982
+ const labelColorClass = disabled ? "text-primary-disabled" : "text-primary";
983
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn(fieldBase, className), children: [
984
+ label && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex w-full items-center justify-between", children: [
985
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { id: labelId, className: cn("paragraph-sm", labelColorClass), children: label }),
986
+ labelRight
987
+ ] }),
988
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "relative w-full", children }),
989
+ !hideHint && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
990
+ "p",
991
+ {
992
+ id: hint ? hintId : void 0,
993
+ className: cn("caption", hint ? hintColorClass : "invisible"),
994
+ children: hint || "\xA0"
995
+ }
996
+ )
997
+ ] });
998
+ };
999
+ Field.displayName = "Field";
1000
+
1001
+ // src/components/Content/Progress.tsx
1002
+ var import_jsx_runtime16 = require("react/jsx-runtime");
963
1003
  var sizeToBarClasses = {
964
1004
  lg: "h-4 rounded-16",
965
1005
  md: "h-2 rounded-8",
966
1006
  sm: "h-1 rounded-4"
967
1007
  };
968
- var Progress = React13.forwardRef(
1008
+ var Progress = React14.forwardRef(
969
1009
  (props, ref) => {
970
1010
  const {
971
1011
  value,
972
1012
  label,
973
1013
  hint,
974
- showLabel = true,
975
- showHint = !!hint,
1014
+ showProgressLabel = true,
1015
+ hideHint,
976
1016
  size = "lg",
1017
+ status = "default",
1018
+ disabled,
977
1019
  className,
978
1020
  ...rest
979
1021
  } = props;
980
1022
  const clamped = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
981
1023
  const percentageLabel = `${Math.round(clamped)}%`;
982
1024
  const barHeightClasses = sizeToBarClasses[size];
983
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
984
- "div",
1025
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1026
+ Field,
985
1027
  {
986
- ref,
987
- className: cn("flex flex-col gap-2 items-start w-full", className),
988
- role: "progressbar",
989
- "aria-valuenow": clamped,
990
- "aria-valuemin": 0,
991
- "aria-valuemax": 100,
992
- "aria-label": label,
993
- ...rest,
994
- children: [
995
- showLabel && label && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex w-full items-center justify-between", children: [
996
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "paragraph-sm-bold text-primary", children: label }),
997
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "footnote text-(--color-secondary)", children: percentageLabel })
998
- ] }),
999
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: cn("w-full bg-(--chart-mono) overflow-hidden", barHeightClasses), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1000
- "div",
1001
- {
1002
- className: cn(
1003
- "bg-(--chart-brand) h-full",
1004
- size === "lg" ? "rounded-4" : size === "md" ? "rounded-2" : "rounded-[1px]"
1005
- ),
1006
- style: { width: `${clamped}%` }
1007
- }
1008
- ) }),
1009
- showHint && hint && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "caption text-(--color-secondary)", children: hint })
1010
- ]
1028
+ label,
1029
+ labelRight: showProgressLabel && label ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
1030
+ hint,
1031
+ hideHint,
1032
+ status,
1033
+ disabled,
1034
+ className: cn("w-full", className),
1035
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1036
+ "div",
1037
+ {
1038
+ ref,
1039
+ role: "progressbar",
1040
+ "aria-valuenow": clamped,
1041
+ "aria-valuemin": 0,
1042
+ "aria-valuemax": 100,
1043
+ "aria-label": label,
1044
+ ...rest,
1045
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1046
+ "div",
1047
+ {
1048
+ className: cn(
1049
+ "w-full bg-(--chart-mono) overflow-hidden",
1050
+ barHeightClasses,
1051
+ disabled && "opacity-50"
1052
+ ),
1053
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1054
+ "div",
1055
+ {
1056
+ className: cn(
1057
+ "bg-(--chart-brand) h-full",
1058
+ size === "lg" ? "rounded-4" : size === "md" ? "rounded-2" : "rounded-[1px]"
1059
+ ),
1060
+ style: { width: `${clamped}%` }
1061
+ }
1062
+ )
1063
+ }
1064
+ )
1065
+ }
1066
+ )
1011
1067
  }
1012
1068
  );
1013
1069
  }
@@ -1015,10 +1071,10 @@ var Progress = React13.forwardRef(
1015
1071
  Progress.displayName = "Progress";
1016
1072
 
1017
1073
  // src/components/Content/StatusAvatar.tsx
1018
- var React14 = __toESM(require("react"), 1);
1074
+ var React15 = __toESM(require("react"), 1);
1019
1075
  var import_class_variance_authority10 = require("class-variance-authority");
1020
1076
  var import_icons3 = require("@bubo-squared/icons");
1021
- var import_jsx_runtime16 = require("react/jsx-runtime");
1077
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1022
1078
  var iconStatusVariants = (0, import_class_variance_authority10.cva)(
1023
1079
  "inline-flex size-5 items-center justify-center rounded-full border-1 border-(--color-primary-inverse) p-1",
1024
1080
  {
@@ -1043,11 +1099,11 @@ var presenceDotByVariant = {
1043
1099
  away: "bg-(--background-warning) border-1 border-(--color-primary-inverse)",
1044
1100
  busy: "bg-(--background-error) border-1 border-(--color-primary-inverse)"
1045
1101
  };
1046
- var StatusAvatar = React14.forwardRef((props, ref) => {
1102
+ var StatusAvatar = React15.forwardRef((props, ref) => {
1047
1103
  const { variant = "verified", className, ...rest } = props;
1048
1104
  if (variant === "offline" || variant === "online" || variant === "away" || variant === "busy") {
1049
1105
  const dotClasses = presenceDotByVariant[variant];
1050
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1106
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1051
1107
  "div",
1052
1108
  {
1053
1109
  ref,
@@ -1056,23 +1112,23 @@ var StatusAvatar = React14.forwardRef((props, ref) => {
1056
1112
  className
1057
1113
  ),
1058
1114
  ...rest,
1059
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn(dotClasses, "size-3.5 rounded-full") })
1115
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: cn(dotClasses, "size-3.5 rounded-full") })
1060
1116
  }
1061
1117
  );
1062
1118
  }
1063
1119
  const iconVariant = variant;
1064
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1120
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1065
1121
  "div",
1066
1122
  {
1067
1123
  ref,
1068
1124
  className: cn(iconStatusVariants({ variant: iconVariant }), className),
1069
1125
  ...rest,
1070
1126
  children: [
1071
- iconVariant === "verified" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons3.CheckIcon, { className: "size-3 text-button-white" }),
1072
- iconVariant === "bookmark" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons3.BookmarkCheckIcon, { className: "size-3 text-button-white" }),
1073
- iconVariant === "favorite" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons3.StarIcon, { className: "size-3 text-button-white" }),
1074
- iconVariant === "add" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons3.PlusIcon, { className: "size-3 text-button-white" }),
1075
- iconVariant === "remove" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons3.CrossIcon, { className: "size-3 text-button-white" })
1127
+ iconVariant === "verified" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons3.CheckIcon, { className: "size-3 text-button-white" }),
1128
+ iconVariant === "bookmark" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons3.BookmarkCheckIcon, { className: "size-3 text-button-white" }),
1129
+ iconVariant === "favorite" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons3.StarIcon, { className: "size-3 text-button-white" }),
1130
+ iconVariant === "add" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons3.PlusIcon, { className: "size-3 text-button-white" }),
1131
+ iconVariant === "remove" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons3.CrossIcon, { className: "size-3 text-button-white" })
1076
1132
  ]
1077
1133
  }
1078
1134
  );
@@ -1080,10 +1136,10 @@ var StatusAvatar = React14.forwardRef((props, ref) => {
1080
1136
  StatusAvatar.displayName = "StatusAvatar";
1081
1137
 
1082
1138
  // src/components/Content/Tag.tsx
1083
- var React15 = __toESM(require("react"), 1);
1139
+ var React16 = __toESM(require("react"), 1);
1084
1140
  var import_react_slot6 = require("@radix-ui/react-slot");
1085
1141
  var import_class_variance_authority11 = require("class-variance-authority");
1086
- var import_jsx_runtime17 = require("react/jsx-runtime");
1142
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1087
1143
  var tagVariants = (0, import_class_variance_authority11.cva)(
1088
1144
  "inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-(--border-secondary) bg-(--background-neutral) hover:border-(--border-secondary-hover) focus:border-(--border-brand) focus-ring-primary ",
1089
1145
  {
@@ -1100,7 +1156,7 @@ var tagVariants = (0, import_class_variance_authority11.cva)(
1100
1156
  );
1101
1157
  var disabledTag = "pointer-events-none border-(--border-secondary-disabled) bg-(--background-neutral-disabled) text-primary-disabled";
1102
1158
  var iconClasses = "flex items-center justify-center w-5 h-5 [&>*]:w-5 [&>*]:h-5 shrink-0 text-primary";
1103
- var Tag = React15.forwardRef(
1159
+ var Tag = React16.forwardRef(
1104
1160
  (props, ref) => {
1105
1161
  const {
1106
1162
  size = "sm",
@@ -1112,22 +1168,22 @@ var Tag = React15.forwardRef(
1112
1168
  ...rest
1113
1169
  } = props;
1114
1170
  const Comp = asChild ? import_react_slot6.Slot : "div";
1115
- const leading = props.leadingIcon && React15.isValidElement(props.leadingIcon) ? React15.cloneElement(props.leadingIcon, { disabled, ...props.leadingIcon.props }) : null;
1116
- const trailing = props.trailingIcon && React15.isValidElement(props.trailingIcon) ? React15.cloneElement(props.trailingIcon, { disabled, ...props.trailingIcon.props }) : null;
1117
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1171
+ const leading = props.leadingIcon && React16.isValidElement(props.leadingIcon) ? React16.cloneElement(props.leadingIcon, { disabled, ...props.leadingIcon.props }) : null;
1172
+ const trailing = props.trailingIcon && React16.isValidElement(props.trailingIcon) ? React16.cloneElement(props.trailingIcon, { disabled, ...props.trailingIcon.props }) : null;
1173
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1118
1174
  Comp,
1119
1175
  {
1120
1176
  className: cn(tagVariants({ size }), disabled && disabledTag, className),
1121
1177
  ref,
1122
1178
  ...rest,
1123
1179
  children: [
1124
- leading && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: iconClasses, children: leading }),
1125
- value ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-row gap-1 items-center", children: [
1126
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
1127
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
1128
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
1129
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default", children: label }),
1130
- trailing && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: iconClasses, children: trailing })
1180
+ leading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: iconClasses, children: leading }),
1181
+ value ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-row gap-1 items-center", children: [
1182
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
1183
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
1184
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
1185
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default", children: label }),
1186
+ trailing && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: iconClasses, children: trailing })
1131
1187
  ]
1132
1188
  }
1133
1189
  );
@@ -1135,14 +1191,14 @@ var Tag = React15.forwardRef(
1135
1191
  );
1136
1192
 
1137
1193
  // src/components/Inputs/Checkbox.tsx
1138
- var React16 = require("react");
1194
+ var React17 = require("react");
1139
1195
  var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
1140
1196
  var import_icons4 = require("@bubo-squared/icons");
1141
1197
  var import_icons5 = require("@bubo-squared/icons");
1142
- var import_jsx_runtime18 = require("react/jsx-runtime");
1198
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1143
1199
  function Checkbox({ label, className, ...props }) {
1144
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "inline-flex items-center gap-(--space-12) cursor-pointer select-none", children: [
1145
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1200
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "inline-flex items-center gap-(--space-12) cursor-pointer select-none", children: [
1201
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1146
1202
  CheckboxPrimitive.Root,
1147
1203
  {
1148
1204
  className: cn(
@@ -1158,22 +1214,21 @@ function Checkbox({ label, className, ...props }) {
1158
1214
  className
1159
1215
  ),
1160
1216
  ...props,
1161
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
1162
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons4.CheckIcon, { className: "h-5 w-5 hidden group-data-[state=checked]:block" }),
1163
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons5.MinusIcon, { className: "h-5 w-5 hidden group-data-[state=indeterminate]:block" })
1217
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
1218
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons4.CheckIcon, { className: "h-5 w-5 hidden group-data-[state=checked]:block" }),
1219
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons5.MinusIcon, { className: "h-5 w-5 hidden group-data-[state=indeterminate]:block" })
1164
1220
  ] })
1165
1221
  }
1166
1222
  ),
1167
- label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "paragraph-md-medium text-primary", children: label })
1223
+ label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "paragraph-md-medium text-primary", children: label })
1168
1224
  ] });
1169
1225
  }
1170
1226
 
1171
1227
  // src/components/Inputs/Dropdown.tsx
1172
- var React17 = __toESM(require("react"), 1);
1228
+ var React18 = __toESM(require("react"), 1);
1173
1229
  var import_class_variance_authority12 = require("class-variance-authority");
1174
1230
  var import_icons6 = require("@bubo-squared/icons");
1175
- var import_jsx_runtime19 = require("react/jsx-runtime");
1176
- var dropdownWrapperBase = "flex flex-col gap-2 items-start";
1231
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1177
1232
  var dropdownTriggerVariants = (0, import_class_variance_authority12.cva)(
1178
1233
  "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-primary-disabled disabled:cursor-default",
1179
1234
  {
@@ -1235,10 +1290,29 @@ var dropdownIconVariants = (0, import_class_variance_authority12.cva)("flex item
1235
1290
  disabled: false
1236
1291
  }
1237
1292
  });
1293
+ var dropdownItemVariants = (0, import_class_variance_authority12.cva)("", {
1294
+ variants: {
1295
+ size: {
1296
+ sm: "h-8",
1297
+ md: "h-10",
1298
+ lg: "h-11",
1299
+ xl: "h-14"
1300
+ }
1301
+ }
1302
+ });
1303
+ var dropdownButtonVariants = (0, import_class_variance_authority12.cva)("flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) text-left paragraph-lg text-primary hover:bg-(--background-secondary)", {
1304
+ variants: {
1305
+ size: {
1306
+ sm: "paragraph-sm py-(--space-4) ",
1307
+ md: "paragraph-md py-(--space-6) ",
1308
+ lg: "paragraph-lg py-(--space-8) ",
1309
+ xl: "subtitle py-(--space-10) "
1310
+ }
1311
+ }
1312
+ });
1238
1313
  var Dropdown = (props) => {
1239
1314
  const {
1240
1315
  label = "Field Label",
1241
- showLabel = true,
1242
1316
  hint = "This is a hint text to help user.",
1243
1317
  hideHint = false,
1244
1318
  placeholder = "Placeholder text",
@@ -1253,12 +1327,12 @@ var Dropdown = (props) => {
1253
1327
  showMenu,
1254
1328
  ...buttonProps
1255
1329
  } = props;
1256
- const dropdownRef = React17.useRef(null);
1330
+ const dropdownRef = React18.useRef(null);
1257
1331
  const isControlled = value !== void 0;
1258
- const [internalValue, setInternalValue] = React17.useState(
1332
+ const [internalValue, setInternalValue] = React18.useState(
1259
1333
  defaultValue
1260
1334
  );
1261
- const [open, setOpen] = React17.useState(false);
1335
+ const [open, setOpen] = React18.useState(false);
1262
1336
  const currentValue = isControlled ? value : internalValue;
1263
1337
  const selectedOption = options.find((opt) => opt.value === currentValue);
1264
1338
  const hasValue = !!selectedOption;
@@ -1278,10 +1352,7 @@ var Dropdown = (props) => {
1278
1352
  setOpen(false);
1279
1353
  }
1280
1354
  };
1281
- const triggerId = React17.useId();
1282
- const labelId = `${triggerId}-label`;
1283
- const hintId = `${triggerId}-hint`;
1284
- React17.useEffect(() => {
1355
+ React18.useEffect(() => {
1285
1356
  if (showMenu !== void 0) return;
1286
1357
  const handleClickOutside = (event) => {
1287
1358
  if (!dropdownRef.current) return;
@@ -1294,144 +1365,97 @@ var Dropdown = (props) => {
1294
1365
  document.removeEventListener("mousedown", handleClickOutside);
1295
1366
  };
1296
1367
  }, [showMenu]);
1297
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: dropdownRef, className: dropdownWrapperBase, children: [
1298
- showLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1299
- "label",
1300
- {
1301
- htmlFor: triggerId,
1302
- id: labelId,
1303
- className: cn(
1304
- "paragraph-sm",
1305
- disabled ? "text-primary-disabled" : "text-primary"
1368
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref: dropdownRef, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1369
+ Field,
1370
+ {
1371
+ label,
1372
+ hint,
1373
+ hideHint,
1374
+ status,
1375
+ disabled,
1376
+ children: [
1377
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1378
+ "button",
1379
+ {
1380
+ type: "button",
1381
+ "aria-haspopup": "listbox",
1382
+ "aria-expanded": isOpen,
1383
+ disabled,
1384
+ className: cn(dropdownTriggerVariants({ size, status }), className),
1385
+ onClick: handleToggle,
1386
+ "data-open": isOpen || void 0,
1387
+ ...buttonProps,
1388
+ children: [
1389
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1390
+ "span",
1391
+ {
1392
+ className: cn(
1393
+ dropdownTextVariants({
1394
+ size,
1395
+ hasValue,
1396
+ disabled: !!disabled
1397
+ })
1398
+ ),
1399
+ children: hasValue ? selectedOption?.label : placeholder
1400
+ }
1401
+ ),
1402
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn(dropdownIconVariants({ size, disabled: !!disabled })), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons6.ChevronDownIcon, {}) })
1403
+ ]
1404
+ }
1306
1405
  ),
1307
- children: label
1308
- }
1309
- ),
1310
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative w-full", children: [
1311
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1312
- "button",
1313
- {
1314
- type: "button",
1315
- id: triggerId,
1316
- "aria-haspopup": "listbox",
1317
- "aria-expanded": isOpen,
1318
- "aria-labelledby": showLabel ? labelId : void 0,
1319
- "aria-describedby": !hideHint ? hintId : void 0,
1320
- disabled,
1321
- className: cn(
1322
- dropdownTriggerVariants({ size, status }),
1323
- className
1406
+ isOpen && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute z-10 mt-1 w-full min-w-343 rounded-4 border border-(--border-secondary-hover) bg-(--background-neutral) shadow-card-md flex overflow-y-scroll dropdown-scrollbar max-h-79", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("ul", { role: "listbox", className: "flex flex-1 flex-col", children: [
1407
+ hasValue && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1408
+ "li",
1409
+ {
1410
+ className: cn(
1411
+ "bg-(--background-neutral) border-b border-(--border-secondary)",
1412
+ dropdownItemVariants({ size })
1413
+ ),
1414
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1415
+ "button",
1416
+ {
1417
+ type: "button",
1418
+ className: cn(dropdownButtonVariants({ size }), "text-secondary"),
1419
+ role: "option",
1420
+ "aria-selected": false,
1421
+ onClick: () => handleSelect(""),
1422
+ children: "Clear"
1423
+ }
1424
+ )
1425
+ }
1324
1426
  ),
1325
- onClick: handleToggle,
1326
- "data-open": isOpen || void 0,
1327
- ...buttonProps,
1328
- children: [
1329
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1330
- "span",
1331
- {
1332
- className: cn(
1333
- dropdownTextVariants({
1334
- size,
1335
- hasValue,
1336
- disabled: !!disabled
1337
- })
1338
- ),
1339
- children: hasValue ? selectedOption?.label : placeholder
1340
- }
1341
- ),
1342
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1343
- "span",
1427
+ options.map((opt) => {
1428
+ const selected = opt.value === currentValue;
1429
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1430
+ "li",
1344
1431
  {
1345
1432
  className: cn(
1346
- dropdownIconVariants({ size, disabled: !!disabled })
1433
+ "bg-(--background-neutral) border-b border-(--border-secondary) last:border-b-0 ",
1434
+ selected && "bg-(--background-secondary)",
1435
+ dropdownItemVariants({ size })
1347
1436
  ),
1348
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons6.ChevronDownIcon, {})
1349
- }
1350
- )
1351
- ]
1352
- }
1353
- ),
1354
- isOpen && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "absolute z-10 mt-1 w-full min-w-343 rounded-4 border border-(--border-primary-hover) bg-(--background-neutral) shadow-card-md flex overflow-y-scroll dropdown-scrollbar max-h-79", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { role: "listbox", className: "flex flex-1 flex-col", children: options.map((opt) => {
1355
- const selected = opt.value === currentValue;
1356
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1357
- "li",
1358
- {
1359
- className: cn(
1360
- "bg-(--background-neutral) border-b border-(--border-secondary) last:border-b-0",
1361
- selected && "bg-(--background-secondary)"
1362
- ),
1363
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1364
- "button",
1365
- {
1366
- type: "button",
1367
- className: "flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) py-(--space-8) text-left paragraph-lg text-primary hover:bg-(--background-secondary)",
1368
- role: "option",
1369
- "aria-selected": selected,
1370
- onClick: () => handleSelect(opt.value),
1371
- children: opt.label
1372
- }
1373
- )
1374
- },
1375
- opt.value
1376
- );
1377
- }) }) })
1378
- ] }),
1379
- !hideHint && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1380
- "p",
1381
- {
1382
- id: hintId,
1383
- className: cn(
1384
- "caption",
1385
- disabled ? "text-primary-disabled" : "text-(--color-secondary)"
1386
- ),
1387
- children: hint
1388
- }
1389
- )
1390
- ] });
1437
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1438
+ "button",
1439
+ {
1440
+ type: "button",
1441
+ className: dropdownButtonVariants({ size }),
1442
+ role: "option",
1443
+ "aria-selected": selected,
1444
+ onClick: () => handleSelect(opt.value),
1445
+ children: opt.label
1446
+ }
1447
+ )
1448
+ },
1449
+ opt.value
1450
+ );
1451
+ })
1452
+ ] }) })
1453
+ ]
1454
+ }
1455
+ ) });
1391
1456
  };
1392
1457
  Dropdown.displayName = "Dropdown";
1393
1458
 
1394
- // src/components/Inputs/Field.tsx
1395
- var React18 = __toESM(require("react"), 1);
1396
- var import_jsx_runtime20 = require("react/jsx-runtime");
1397
- var fieldBase = "flex flex-col gap-2 items-start";
1398
- var Field = (props) => {
1399
- const {
1400
- label,
1401
- hint,
1402
- hideHint,
1403
- status = "default",
1404
- disabled,
1405
- className,
1406
- children
1407
- } = props;
1408
- const fieldId = React18.useId();
1409
- const labelId = label ? `${fieldId}-label` : void 0;
1410
- const hintId = hint ? `${fieldId}-hint` : void 0;
1411
- const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
1412
- const labelColorClass = disabled ? "text-primary-disabled" : "text-primary";
1413
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn(fieldBase, className), children: [
1414
- label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1415
- "label",
1416
- {
1417
- id: labelId,
1418
- className: cn("paragraph-sm", labelColorClass),
1419
- children: label
1420
- }
1421
- ),
1422
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative w-full", children }),
1423
- !hideHint && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1424
- "p",
1425
- {
1426
- id: hint ? hintId : void 0,
1427
- className: cn("caption", hint ? hintColorClass : "invisible"),
1428
- children: hint || "\xA0"
1429
- }
1430
- )
1431
- ] });
1432
- };
1433
- Field.displayName = "Field";
1434
-
1435
1459
  // src/components/Inputs/PasswordInput.tsx
1436
1460
  var React21 = __toESM(require("react"), 1);
1437
1461
  var import_class_variance_authority14 = require("class-variance-authority");
@@ -1510,6 +1534,7 @@ var InputShell = React20.forwardRef(
1510
1534
  InputShell.displayName = "InputShell";
1511
1535
 
1512
1536
  // src/components/Inputs/PasswordInput.tsx
1537
+ var import_icons7 = require("@bubo-squared/icons");
1513
1538
  var import_jsx_runtime23 = require("react/jsx-runtime");
1514
1539
  var passwordTextVariants = (0, import_class_variance_authority14.cva)("truncate", {
1515
1540
  variants: {
@@ -1575,13 +1600,10 @@ var PasswordInput = (props) => {
1575
1600
  placeholder = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
1576
1601
  size = "lg",
1577
1602
  status = "default",
1578
- variant = "icons",
1603
+ variant = "icon",
1579
1604
  disabled,
1580
1605
  className,
1581
1606
  leadingIcon,
1582
- trailingIcon,
1583
- actionLabel = "Action",
1584
- onActionClick,
1585
1607
  value,
1586
1608
  defaultValue,
1587
1609
  onChange,
@@ -1591,8 +1613,10 @@ var PasswordInput = (props) => {
1591
1613
  const [internalValue, setInternalValue] = React21.useState(
1592
1614
  defaultValue ?? ""
1593
1615
  );
1616
+ const [isRevealed, setIsRevealed] = React21.useState(false);
1594
1617
  const currentValue = (isControlled ? value : internalValue) ?? "";
1595
1618
  const inputRef = React21.useRef(null);
1619
+ const showLeadingIcon = !!leadingIcon;
1596
1620
  const handleContainerClick = () => {
1597
1621
  if (disabled) return;
1598
1622
  inputRef.current?.focus();
@@ -1603,9 +1627,6 @@ var PasswordInput = (props) => {
1603
1627
  }
1604
1628
  onChange?.(event);
1605
1629
  };
1606
- const showLeadingIcon = variant === "icons" && !!leadingIcon;
1607
- const showTrailingIcon = variant === "icons" && !!trailingIcon;
1608
- const showAction = variant === "action" && !!actionLabel;
1609
1630
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1610
1631
  Field,
1611
1632
  {
@@ -1636,37 +1657,33 @@ var PasswordInput = (props) => {
1636
1657
  Input,
1637
1658
  {
1638
1659
  ref: inputRef,
1639
- type: "password",
1660
+ type: isRevealed ? "text" : "password",
1640
1661
  disabled: disabled ?? void 0,
1641
1662
  placeholder,
1642
1663
  value: isControlled ? value : currentValue,
1643
1664
  defaultValue: isControlled ? void 0 : defaultValue,
1644
1665
  onChange: handleChange,
1645
1666
  variant: "bare",
1646
- className: cn(
1647
- passwordTextVariants({ size, disabled: !!disabled })
1648
- ),
1667
+ className: cn(passwordTextVariants({ size, disabled: !!disabled })),
1649
1668
  ...inputProps
1650
1669
  }
1651
1670
  ),
1652
- showTrailingIcon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1653
- "span",
1654
- {
1655
- className: cn(
1656
- iconWrapperVariants({ size, disabled: !!disabled })
1657
- ),
1658
- children: trailingIcon
1659
- }
1660
- ),
1661
- showAction && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1671
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1662
1672
  "button",
1663
1673
  {
1664
1674
  type: "button",
1675
+ disabled: !!disabled,
1676
+ onClick: () => {
1677
+ if (disabled) return;
1678
+ setIsRevealed((prev) => !prev);
1679
+ inputRef.current?.focus();
1680
+ },
1681
+ "aria-label": isRevealed ? "Hide password" : "Show password",
1665
1682
  className: cn(
1666
- actionButtonVariants({ size, disabled: !!disabled })
1683
+ "cursor-pointer",
1684
+ variant === "text" ? actionButtonVariants({ size, disabled: !!disabled }) : iconWrapperVariants({ size, disabled: !!disabled })
1667
1685
  ),
1668
- onClick: disabled ? void 0 : onActionClick,
1669
- children: actionLabel
1686
+ children: variant === "icon" ? isRevealed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons7.EyeSlashIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons7.EyeIcon, {}) : isRevealed ? "Hide" : "Show"
1670
1687
  }
1671
1688
  )
1672
1689
  ]
@@ -1679,7 +1696,7 @@ PasswordInput.displayName = "PasswordInput";
1679
1696
 
1680
1697
  // src/components/Inputs/PhoneInput.tsx
1681
1698
  var React27 = __toESM(require("react"), 1);
1682
- var import_icons8 = require("@bubo-squared/icons");
1699
+ var import_icons9 = require("@bubo-squared/icons");
1683
1700
  var RPNInput = __toESM(require("react-phone-number-input"), 1);
1684
1701
  var import_flags = __toESM(require("react-phone-number-input/flags"), 1);
1685
1702
 
@@ -1738,7 +1755,7 @@ function Button2({
1738
1755
  // src/components/ui/command.tsx
1739
1756
  var React24 = require("react");
1740
1757
  var import_cmdk = require("cmdk");
1741
- var import_icons7 = require("@bubo-squared/icons");
1758
+ var import_icons8 = require("@bubo-squared/icons");
1742
1759
 
1743
1760
  // src/components/ui/dialog.tsx
1744
1761
  var React23 = require("react");
@@ -1773,7 +1790,7 @@ function CommandInput({
1773
1790
  "data-slot": "command-input-wrapper",
1774
1791
  className: "flex h-9 items-center gap-2 border-b px-3",
1775
1792
  children: [
1776
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_icons7.SearchIcon, { className: "size-4 shrink-0 opacity-50 text-(--color-secondary)" }),
1793
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_icons8.SearchIcon, { className: "size-4 shrink-0 opacity-50 text-(--color-secondary)" }),
1777
1794
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1778
1795
  import_cmdk.Command.Input,
1779
1796
  {
@@ -2080,7 +2097,7 @@ var CountrySelect = ({
2080
2097
  }
2081
2098
  ),
2082
2099
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2083
- import_icons8.CodeIcon,
2100
+ import_icons9.CodeIcon,
2084
2101
  {
2085
2102
  className: cn(
2086
2103
  "-mr-2 size-4 opacity-50 rotate-90",
@@ -2162,7 +2179,7 @@ var CountrySelectOption = (props) => {
2162
2179
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "flex-1 text-sm", children: countryName }),
2163
2180
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm text-foreground/50", children: `+${RPNInput.getCountryCallingCode(country)}` }),
2164
2181
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2165
- import_icons8.CheckIcon,
2182
+ import_icons9.CheckIcon,
2166
2183
  {
2167
2184
  className: `ml-auto size-4 ${country === selectedCountry ? "opacity-100" : "opacity-0"}`
2168
2185
  }
@@ -2316,7 +2333,7 @@ var RadioGroup = ({
2316
2333
  // src/components/Inputs/SearchInput.tsx
2317
2334
  var React29 = __toESM(require("react"), 1);
2318
2335
  var import_class_variance_authority17 = require("class-variance-authority");
2319
- var import_icons9 = require("@bubo-squared/icons");
2336
+ var import_icons10 = require("@bubo-squared/icons");
2320
2337
  var import_jsx_runtime31 = require("react/jsx-runtime");
2321
2338
  var searchTextVariants = (0, import_class_variance_authority17.cva)("truncate", {
2322
2339
  variants: {
@@ -2373,7 +2390,7 @@ var SearchInput = (props) => {
2373
2390
  className,
2374
2391
  onClick: handleContainerClick,
2375
2392
  children: [
2376
- showLeadingIcon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn(iconWrapperVariants2({ size, disabled: !!disabled })), children: leadingIcon ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons9.SearchIcon, {}) }),
2393
+ showLeadingIcon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn(iconWrapperVariants2({ size, disabled: !!disabled })), children: leadingIcon ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons10.SearchIcon, {}) }),
2377
2394
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2378
2395
  Input,
2379
2396
  {
@@ -2808,7 +2825,7 @@ Slider.displayName = "Slider";
2808
2825
 
2809
2826
  // src/components/Inputs/TextArea.tsx
2810
2827
  var React31 = __toESM(require("react"), 1);
2811
- var import_icons10 = require("@bubo-squared/icons");
2828
+ var import_icons11 = require("@bubo-squared/icons");
2812
2829
  var import_jsx_runtime33 = require("react/jsx-runtime");
2813
2830
  var wrapperBase3 = "flex flex-col gap-2 items-start w-full";
2814
2831
  var TextArea = (props) => {
@@ -2970,7 +2987,7 @@ var TextArea = (props) => {
2970
2987
  "absolute bottom-0 right-0 flex h-4 w-4 items-center justify-center text-(--icon-primary)",
2971
2988
  disabled && "text-(--icon-primary-disabled)"
2972
2989
  ),
2973
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons10.MaximizeIcon, {})
2990
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons11.MaximizeIcon, {})
2974
2991
  }
2975
2992
  )
2976
2993
  }
@@ -3369,7 +3386,7 @@ Popover2.displayName = "Popover";
3369
3386
  var React36 = __toESM(require("react"), 1);
3370
3387
  var import_react_slot8 = require("@radix-ui/react-slot");
3371
3388
  var import_class_variance_authority19 = require("class-variance-authority");
3372
- var import_icons11 = require("@bubo-squared/icons");
3389
+ var import_icons12 = require("@bubo-squared/icons");
3373
3390
  var import_jsx_runtime38 = require("react/jsx-runtime");
3374
3391
  var breadcrumbBase = "group inline-flex items-center gap-[var(--space-8)] pl-0 pr-[var(--space-8)] py-[6px] rounded-full transition-colors select-none disabled:cursor-default disabled:pointer-events-none";
3375
3392
  var breadcrumbIconVariants = (0, import_class_variance_authority19.cva)(
@@ -3422,7 +3439,7 @@ var Breadcrumb = React36.forwardRef((props, ref) => {
3422
3439
  ref,
3423
3440
  ...rest,
3424
3441
  children: [
3425
- showIcon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn(breadcrumbIconVariants({ variant })), children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons11.ChevronRightIcon, {}) }),
3442
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn(breadcrumbIconVariants({ variant })), children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons12.ChevronRightIcon, {}) }),
3426
3443
  content && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn(breadcrumbTextVariants({ variant })), children: content })
3427
3444
  ]
3428
3445
  }