@refinn/core-ui 0.1.24 → 0.1.26

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
@@ -2118,7 +2118,12 @@ var Dropdown = (0, import_react16.forwardRef)(
2118
2118
  }, rest), {
2119
2119
  onClick: () => {
2120
2120
  var _a2;
2121
- return !disabled && ((_a2 = inputRef.current) == null ? void 0 : _a2.focus());
2121
+ if (disabled) return;
2122
+ if (!isOpen) {
2123
+ setIsOpen(true);
2124
+ setFilterText("");
2125
+ }
2126
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2122
2127
  },
2123
2128
  className: triggerClassName,
2124
2129
  children: [
@@ -2180,6 +2185,8 @@ var Dropdown = (0, import_react16.forwardRef)(
2180
2185
  setIsOpen(false);
2181
2186
  setQuery(value.label || "");
2182
2187
  } else {
2188
+ setIsOpen(true);
2189
+ setFilterText("");
2183
2190
  (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2184
2191
  }
2185
2192
  }
@@ -2667,11 +2674,11 @@ var SegmentControl = (0, import_react21.forwardRef)(
2667
2674
  setSelected == null ? void 0 : setSelected(item.value);
2668
2675
  onChange == null ? void 0 : onChange(item.value);
2669
2676
  },
2670
- className: "group flex-1 min-w-0 rounded-full border-2 border-transparent p-2 outline-none cursor-pointer transition-colors focus-visible:border-segmented-control-border-focus",
2677
+ className: "group flex-1 min-w-0 rounded-full outline-none cursor-pointer",
2671
2678
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2672
2679
  "span",
2673
2680
  {
2674
- className: `flex w-full items-center justify-center rounded-full text-center transition-colors ${itemSizeClasses[size]} ${isSelected ? "bg-segmented-control-background-active text-segmented-control-text-inverse shadow-small group-focus-visible:bg-segmented-control-background-active-focus group-focus-visible:text-segmented-control-text-primary" : "text-segmented-control-text-primary hover:bg-segmented-control-background-hover"}`,
2681
+ className: `flex w-full items-center justify-center rounded-full text-center transition-colors group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-segmented-control-border-focus ${itemSizeClasses[size]} ${isSelected ? "bg-segmented-control-background-active text-segmented-control-text-inverse shadow-small group-focus-visible:bg-segmented-control-background-active-focus group-focus-visible:text-segmented-control-text-primary" : "text-segmented-control-text-primary hover:bg-segmented-control-background-hover"}`,
2675
2682
  children: item.label
2676
2683
  }
2677
2684
  )
package/dist/index.js CHANGED
@@ -2115,7 +2115,12 @@ var Dropdown = forwardRef16(
2115
2115
  }, rest), {
2116
2116
  onClick: () => {
2117
2117
  var _a2;
2118
- return !disabled && ((_a2 = inputRef.current) == null ? void 0 : _a2.focus());
2118
+ if (disabled) return;
2119
+ if (!isOpen) {
2120
+ setIsOpen(true);
2121
+ setFilterText("");
2122
+ }
2123
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2119
2124
  },
2120
2125
  className: triggerClassName,
2121
2126
  children: [
@@ -2177,6 +2182,8 @@ var Dropdown = forwardRef16(
2177
2182
  setIsOpen(false);
2178
2183
  setQuery(value.label || "");
2179
2184
  } else {
2185
+ setIsOpen(true);
2186
+ setFilterText("");
2180
2187
  (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2181
2188
  }
2182
2189
  }
@@ -2667,11 +2674,11 @@ var SegmentControl = forwardRef21(
2667
2674
  setSelected == null ? void 0 : setSelected(item.value);
2668
2675
  onChange == null ? void 0 : onChange(item.value);
2669
2676
  },
2670
- className: "group flex-1 min-w-0 rounded-full border-2 border-transparent p-2 outline-none cursor-pointer transition-colors focus-visible:border-segmented-control-border-focus",
2677
+ className: "group flex-1 min-w-0 rounded-full outline-none cursor-pointer",
2671
2678
  children: /* @__PURE__ */ jsx21(
2672
2679
  "span",
2673
2680
  {
2674
- className: `flex w-full items-center justify-center rounded-full text-center transition-colors ${itemSizeClasses[size]} ${isSelected ? "bg-segmented-control-background-active text-segmented-control-text-inverse shadow-small group-focus-visible:bg-segmented-control-background-active-focus group-focus-visible:text-segmented-control-text-primary" : "text-segmented-control-text-primary hover:bg-segmented-control-background-hover"}`,
2681
+ className: `flex w-full items-center justify-center rounded-full text-center transition-colors group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-segmented-control-border-focus ${itemSizeClasses[size]} ${isSelected ? "bg-segmented-control-background-active text-segmented-control-text-inverse shadow-small group-focus-visible:bg-segmented-control-background-active-focus group-focus-visible:text-segmented-control-text-primary" : "text-segmented-control-text-primary hover:bg-segmented-control-background-hover"}`,
2675
2682
  children: item.label
2676
2683
  }
2677
2684
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinn/core-ui",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Refinn Design System — UI components + Tailwind v4 theme preset",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",